Using M2L Color Table

   Print  Previous  Next

Functions Provided For Using The M2L Color Table

Some effects provide more than one color. In this case the so-called »Using Color Table, »Using Color Gradient, »Using 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 TRUE to activate the fade. Use FALSE to deactivate it.

int M2LColorTableGetColorFade()

Returns TRUE, if Fade is activated, otherwise 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.


MADRIX 2.X To MADRIX 3.X Migration Hints

The following functions and constants are not supported anymore. Please follow the hints to migrate your macros.



void SetFade(int enable)

Use M2LColorTableSetColorFade(int enable) instead.

int GetFade()

Use M2LColorTableGetColorFade() instead.



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: 3.6f | Script Version: 2.19
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
Print   Previous   Next