pymel.core.general.displayColor

displayColor(*args, **kwargs)

This command changes or queries the display color for anything in the application that allows the user to set its color. The color is defined by a color index into either the dormant or active color palette. These colors are part of the UI and not part of the saved data for a model. This command is not undoable. In query mode, return type is based on queried flag.

Flags:

Long Name / Short Name Argument Types Properties
active / a bool ../../../_images/create.gif
  Specifies the color index applies to active color palette. name Specifies the name of color to change. index The color index for the color.
create / c bool ../../../_images/create.gif
  Creates a new display color which can be queried or set. If is used only when saving color preferences.
dormant / d bool ../../../_images/create.gif
  Specifies the color index applies to dormant color palette. If neither of the dormant or active flags is specified, dormant is the default.
list / l bool ../../../_images/create.gif
  Writes out a list of all color names and their value.
queryIndex / qi int ../../../_images/create.gif
  Allows you to obtain a list of color names with the given color indices.
resetToFactory / rf bool ../../../_images/create.gif
  Resets all display colors to their factory defaults.
resetToSaved / rs bool ../../../_images/create.gif
  Resets all display colors to their saved values. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.displayColor

Example:

import pymel.core as pm

pm.displayColor( 'grid', 15, dormant=True )
pm.displayColor( 'grid', q=True, dormant=True )
pm.displayColor( list=True )
pm.displayColor( resetToFactory=True )
pm.displayColor( queryIndex=15 )