Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

color( [objects] , [rgbColor=[float, float, float]], [userDefined=int])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

color is undoable, NOT queryable, and NOT editable.

This command sets the dormant wireframe color of the specified objects to be their class color or if the -ud/userDefined flag is specified, one of the user defined colors. The -rgb/rgbColor flags can be specified if the user requires floating point RGB colors.

Return value

None

Flags

rgbColor, userDefined
Long name (short name) Argument types Properties
rgbColor(rgb) [float, float, float] create
Specifies and rgb color to set the selected object to.
userDefined(ud) int create
Specifies the user defined color index to set selected object to. The valid range of numbers is [1-8].

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# create a sphere and deselect it
cmds.sphere( n='sphere1' )
cmds.select( d=True )

# Set the inactive wireframe color of the sphere to the
# first user defined color
cmds.color( 'sphere1', ud=1 )

# rgb defined color (red)
cmds.color( 'sphere1', rgb=(1, 0, 0) )

# set the wireframe color of the sphere back to its default color
cmds.color( 'sphere1' )