Using Color Gradient

  Previous  Next

Functions Provided For Using The Color Gradient

Some effects provide more than one color. In this case the so-called »Color Table, Color Gradient (described here), »Color Gradient Dialog or »M2L Color Table is offered by the effect to take control of the colors.

Gradient Color Controls

 

The following table provides an overview of all functions the effect can use to modify the colors in a Color Gradient:

Function

Description

void GradientSetColor(int idx, color c)

Sets the color with the specified index to the given color value. If the index is out of range, nothing happens.

color GradientGetColor(int idx)

Returns the color with the specified index. If the index is out of range, black is returned.

int GradientGetColorCount()

Returns the current number of colors in the Color Gradient.

void GradientAddColor(color c, float position, int fade)

Adds another color to the Color Gradient at the specified position. The position value have to be between 0.0 and 1.0. The inserted color will be faded the color before if the fade value is 1 (TRUE).

void GradientRemoveColor(int idx)

Removes the color at the specified index. If the given index is out of range, nothing happens.

void GradientSetColorPosition(int idx, float pos)

Sets the color with the specified index to the given position value. The position value have to be between 0.0 and 1.0. If the index is out of range, nothing happens.

float GradientGetColorPosition(int idx)

Returns the position of the color with the specified index. If the index is out of range, 0.0 is returned.

void GradientSetColorFade(int idx, int fade)

Use 1 (TRUE) to activate the color fade mode for the color with the specified index. Use 0 (FALSE) to deactivate it.

int GradientGetColorFade(int idx)

Returns 1 (TRUE) if the color fade mode is activated for the color with the specified index, otherwise 0 (FALSE).

void GradientFadeAllColors(void)

Activates the color fade mode for all colors in the Color Gradient.

void GradientFadeNoneColors(void)

Deactivates the color fade mode for all colors in the Color Gradient.

void GradientSetUniformDistances(void)

Sets the position values of each color in the Color Gradient to get uniform distances between each color.

void GradientInvertColorPositions(void)

Inverts the position values off all colors.

void GradientInvertColors(void)

Inverts all color values.

void GradientSetByGlobalId(int ID)

Selects a Global Color List as specified by its ID to be used in this Color Gradient.

int GradientGetGlobalId()

Returns the ID of the Global Color List that is currently selected in this Color Gradient.

 

For a detailed description of the non-primitive data type color, see »Using Data Types

 

 

MADRIX Version: 5.6 | Script Version: 3.18
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
 Previous   Next

 


Enable automatic translation | Activer la traduction automatique |