The index specifies a color index in the color palette. The r, g, and b values (between 0-1) specify the RGB values (or the HSV values if the -hsv flag is used) for the color.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
hueSaturationValue (hsv) | bool | ||
Indicates that rgb values are really hsv values. Upon query, returns the HSV valuses as an array of 3 floats.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
resetToFactory (rf) | bool | ||
|
|||
resetToSaved (rs) | bool | ||
|
Derived from mel command maya.cmds.colorIndex
Example:
import pymel.core as pm
# Set the first entry in the color palette to have RGB values 1 0 0 - red.
pm.colorIndex( 1, 1, 0, 0 )
# Result: 1 #
# Set the first entry in the color palette to have HSV values 360 1 1 - red.
pm.colorIndex( 1, 360, 0, 0, hsv=True )
# Result: 1 #
# Return the RGB color values of the first entry of the color palette.
pm.colorIndex( 1, q=True )
# Result: [0.0, 0.0, 0.0] #
# Return the HSV color values of the first entry of the color palette.
pm.colorIndex( 1, q=True, hsv=True )
# Result: [0.0, 0.0, 0.0] #