19/11/2018: better preview, improved input method and preview update performance.
06/12/2018: inspector testing tools: Sample Test allows to quickly test the color resulting from a [0..1] value.
Please note that whilst images in this documentation are still OK for reference they are not up to date and they will be updated as soon as possible.
Unity 3D's Gradient is a handy data type but comes with some limitations: for example you cannot set more than 8 color keys in its editor and RGB is the only color space available. ColorBand data type offers an alternative with less limitations. Creating ColorBands is fun and easy; they are stored as assets and can be accessed from code through an Evaluate method to get the color at time t, as for Gradient. RGB (or HSV) values are described by individual curves, allowing a better control over how the color function evolves between your points. Color bands are used in all kinds of applications including games, data visualization and other fields.
Examples of color bands you cannot obtain with Unity's Gradient
Newly created ColorBands will be placed in Assets folder's root.
Declare a public ColorBand variable in your script
Assign a color band asset to it
Use it in code by calling the ColorBand.Evaluate(float t) method where t is a floating point value between 0 and 1.
A ColorBand can be discretized which means it will be turned into a set of flat intervals that will return a constant color. To make a ColorBand discrete just set its discrete toggle to true and decide the number of steps the ColorBand will be subdivided into. This will result in discrete bands like the following:
Three different discretization methods are available:
ColorBands can be described in the two main, standard color spaces RGB and HSV. By default a ColorBand will be set to RGB. When changing color space all the curves remain unvaried but they represent the respective values of the two spaces so that when switching to HSV, the first curve becomes hue, the second one saturation and the third one value. The alpha curve has the same meaning in both color spaces.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4