Predefined Functions – gradient
|Function name:||gradient – Return color from palette|
|Input data type||Output data type|
This function returns a color from the palette (gradient), which is assigned to the fractal. The settings in the inside/outside tab of the fractal have influence on this function. If they are set to their default values (Mapping=”linear”, Speed=1, Accel=1, Offset=0), then input values from 0 to 1 will be mapped to the whole gradient, i.e.:
- gradient(0) will return the very first color
- gradient(0.5) will return the color in the middle of the palette
- gradient(1) will return the last color of the palette
If you change the settings in the inside/outside tab, then the mapping will be changed, too.
This function transforms its parameter into a color exactly in the same way as ChaosPro maps an index value from a coloring algorithm to a color.
As mentioned before, this function uses the settings in the inside or outside tab of the fractal. If this function gets called from within a coloring formula which has been assigned to the inner area of a fractal, then the inside settings will be used. In all other cases the outside settings will be used. So if a transformation formula uses this function (for whatever purpose), then the settings from the outside tab will be used to transform the parameter before it is used as an index into the palette.