Save-Point
Define a Gradiated Color - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+----- Thread: Define a Gradiated Color (/thread-6881.html)



Define a Gradiated Color - Tsunokiette - 07-05-2006

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Hello, this is a method which allows you to input a gradient and return a color on a point of the gradient depending on what data you give it. This allows for creating bars that gradualy change color as they deplete.
It supports any number of colors which will be used in the order you supply them. (100% will return the last color)

First off is the code, place this above every other script.

Code


The call is straightforward -

Code:
self.contents.gradiated_color?(colors,width,percentage)


Colors = The colors to be used to create a faux gradient
Width = The width the bar is going to be, is used to determine where to find the color
Percentage = The percentage of how full the bar is, is also used to determine where to find the color