< Previous | Contents | Next >
The ColorControl adds a dialog used to select a color. It actually consists of several different sliders and button controls combined together.
All of the Inputs associated with a ColorControl return a Text value. To add a ColorControl, set the INPID_InputControl attribute of the AddInput function to the string "ColorControl".
All the Inputs that make up a ColorControl should have the same IC_ControlGroup attribute. The Red slider should have an IC_ControlID of 0, Green is 1, Blue is 2 and Alpha is 3. See the example below.
Note that each of the elements is optional - it is perfectly valid to have a color control that displays only an Alpha slider, for example. Additionally, this control can be used to show more than just RGBA. This can be handy for producing color pickers for other channels in the image.
0=Red, 1=Green, 2=Blue, 3=Alpha, 4=BackgroundR, 5=BackgroundG, 6=BackgroundB. 7=BackgroundA, RealR,RealG,RealB,RealA, 12=Coverage, 13=NormalX, 14=NormalY, 15=NormalZ, 16=Z, 17=U, 18=V, 19=Object, 20=Material.
Name | Type : Description |
CLRC_ShowWheel | boolean : This optional attribute determines whether the color wheel will be displayed. |
CLRC_ColorSpace | string : This optional attribute is used to specify which color space is used to draw the wheel. Valid options are "HSV", "HLS" and "YUV". |
An example of a full ColorControl.
InR = self:AddInput("Red", "Red", { LINKID_DataType = "Number", INPID_InputControl = "ColorControl", INP_MinScale = 0.0,
INP_MaxScale = 1.0,
INP_Default = 1.0, ICS_Name = "Color", IC_ControlGroup = 1,
IC_ControlID = 0,
})
InG = self:AddInput("Green", "Green", { LINKID_DataType = "Number", INPID_InputControl = "ColorControl", INP_MinScale = 0.0,
INP_MaxScale = 1.0,
INP_Default = 1.0,
IC_ControlGroup = 1,
IC_ControlID = 1,
})
InB = self:AddInput("Blue", "Blue", { LINKID_DataType = "Number", INPID_InputControl = "ColorControl", INP_MinScale = 0.0,
INP_MaxScale = 1.0,
INP_Default = 1.0,
IC_ControlGroup = 1,
IC_ControlID = 2,
})
InA = self:AddInput("Alpha", "Alpha", {