Softimage SDK Programmer's Guide > Customizing with the SDK > Custom Properties > Property Page Controls > Numeric Controls >

# RGBA Color Control

RGBA Color controls display a preview pane, the RGB/HLS/HSV toggle button, a numerical edit box and a color slider along with an optional animation divot and an optional label. They are associated to four underlying Float or Double parameters.

Note

It is crucial to create the underlying parameters in the R-G-B-A order when defining them for this control, because the control takes the name of the red parameter only and assumes that the green is the next, then blue, followed by the alpha.

Tip

To provide a valid value range for your slider, set the Parameter.Min or Parameter::GetMin and Parameter.Max or Parameter::GetMax properties when you create each parameter.

You create them using the PPGLayout.AddColor or PPGLayout::AddColor method with the Alpha parameter set to true.

    // ** during parameter definition (for example, in the DefineLayout callback) **
    oCustomProperty.AddParameter3( "MyRed", siDouble, 0, 0, 255 );
    oCustomProperty.AddParameter3( "MyGreen", siDouble, 0, 0, 255 );
    oCustomProperty.AddParameter3( "MyBlue", siDouble, 0, 0, 255 );
    oCustomProperty.AddParameter3( "MyAlpha", siDouble, 0, 0, 255 );
    // ...

    // ** during control creation (for example, in the DefineLayout callback) **
    oLayout.AddColor( "MyRed", "Pick a Color", true );

Note

You can also use the PPGLayout.AddItem or PPGLayout::AddItem method with the siControlRGBA control type enum, but the PPGLayout.AddColor or PPGLayout::AddColor method is a little more convenient.

The following item attributes are available:

Available on all Controls also as a property on the PPGItem object: | Common to many Controls:
--- | ---
siUILabel siUIItems siUIType siUIWidthPercentage siUILabelPercentage siUILabelMinPixels | siUINoLabel siUIValueOnly siUIContinue