Using M2L Color Table

  Previous  Next

Functions Provided For Using The M2L Color Table

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

M2L Color Table


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



void M2LColorTableSetColor(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 M2LColorTableGetColor(int idx)

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

void M2LColorTableSetPreset(int preset)

Sets the M2L Color Table preset. Please use a constant as described below for preset.

void M2LColorTableSetColorFade(int enable)

Sets the Fade option. Use 1 (TRUE) to activate the fade. Use 0 (FALSE) to deactivate it.

int M2LColorTableGetColorFade()

Returns 1 (TRUE) if Fade is activated, otherwise 0 (FALSE).

void M2LColorTableToggleColorFade()

Toggles the Fade option.


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



Not every function might be available for each MADRIX effect. Therefore, the functions M2LColorTableSetColorFade, M2LColorTableGetColorFade, and M2LColorTableToggleColorFade are only available if the effect offers Fade Mode.


M2L Color Table Preset Constants




Sets preset C1.


Sets preset C2.


Sets preset R.


Sets preset G.


Sets preset B.



This example sets the M2L Color Table preset C1 and sets the last 12 colors to color black.

void InitEffect()
 //Set Preset C1
 //Sets the last 12 colors to black
 for(int i=12;i<24;i++)
void PreRenderEffect()
void PostRenderEffect()
void MatrixSizeChanged()

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


Enable automatic translation | Activer la traduction automatique |