pymel.core.windows.grabColor

static windows.grabColor(*args, **kwargs)

This command changes the cursor and enters a modal state which will be exited by pressing a mouse button. The color component values of the pixel below the cursor at the time of the button press are returned. Three float values representing the color components of the pixel below the cursor. If no flags are specified then the default is to return the red, green and blue color components.

Flags:
Long name (short name) Argument Types Properties
hsvValue (hsv) bool ../../../_images/create.gif
 

The 3 returned float values will specify the hue, saturation and value color components. Flag can have multiple arguments, passed either as a tuple or a list.

rgbValue (rgb) bool ../../../_images/create.gif
 
The 3 returned float values will specify the red, green and blue color components.

Derived from mel command maya.cmds.grabColor

Example:

import pymel.core as pm

pm.grabColor()
# Result: [0.3960784375667572, 0.3960784375667572, 0.3960784375667572] #
pm.grabColor( hsv=True )
# Result: [0.0, 0.0, 0.38823530077934265] #
color = pm.grabColor()

Previous topic

pymel.core.windows.glRenderEditor

Next topic

pymel.core.windows.gradientControl

Core

Core Modules

Other Modules

This Page