pymel.core.datatypes.Color

Inheritance diagram of Color

class Color(*args, **kwargs)

A 4 dimensional vector class that wraps Maya’s api Color class, It stores the r, g, b, a components of the color, as normalized (Python) floats

MColorType = Enum( EnumValue('MColorType', 0, 'RGB'), EnumValue('MColorType', 1, 'HSV'), EnumValue('MColorType', 2, 'CMY'), EnumValue('MColorType', 3, 'CMYK'))
a
apicls

alias of MColor

b
black = dt.Color([0.0, 0.0, 0.0, 1.0])
blue = dt.Color([0.0, 0.0, 1.0, 1.0])
clear = dt.Color([0.0, 0.0, 0.0, 0.0])
cnames = ('r', 'g', 'b', 'a')
g
gamma(g)

c.gamma(g) applies gamma correction g to Color c, g can be a scalar and then will be applied to r, g, b or an iterable of up to 3 (r, g, b) independant gamma correction values

green = dt.Color([0.0, 1.0, 0.0, 1.0])
h

The h Color component

hsv

The h,s,v,a Color components

hsva

The h,s,v,a Color components

hsvblend(other, weight=0.5)

c1.hsvblend(c2) –> Color Returns the result of blending c1 with c2 in hsv space, using the given weight

static hsvtorgb(c)
kOpaqueBlack = dt.Color([0.0, 0.0, 0.0, 1.0])
modes = ('rgb', 'hsv')
ndim = 1
one = dt.Color([1.0, 1.0, 1.0, 1.0])
opaque = dt.Color([0.0, 0.0, 0.0, 1.0])
over(other)

c1.over(c2): Composites c1 over other c2 using c1’s alpha, the resulting color has the alpha of c2

premult()

Premultiply Color r, g and b by it’s alpha and resets alpha to 1.0

r
red = dt.Color([1.0, 0.0, 0.0, 1.0])
rgb

The r,g,b Color components

rgba

The r,g,b,a Color components

static rgbtohsv(c)
s

The s Color component

set(colorModel, c1, c2, c3, alpha=1.0)

Color component assigment.

Parameters :
colorModel : Color.MColorType

The color model.

values: ‘RGB’, ‘HSV’, ‘CMY’, ‘CMYK’

c1 : float

First component of color.

c2 : float

Second component of color.

c3 : float

Third component of color.

alpha : float

Alpha component of color.

Return type:

bool

Derived from api method maya.OpenMaya.MColor.set

shape = (4,)
size = 4
v

The v Color component

white = dt.Color([1.0, 1.0, 1.0, 1.0])
xAxis = dt.Color([1.0, 0.0, 0.0, 1.0])
xNegAxis = dt.Color([-1.0, 0.0, 0.0, 1.0])
yAxis = dt.Color([0.0, 1.0, 0.0, 1.0])
yNegAxis = dt.Color([0.0, -1.0, 0.0, 1.0])
zAxis = dt.Color([0.0, 0.0, 1.0, 1.0])
zNegAxis = dt.Color([0.0, 0.0, -1.0, 1.0])
zero = dt.Color([0.0, 0.0, 0.0, 1.0])

Previous topic

pymel.core.datatypes.BoundingBox

Next topic

pymel.core.datatypes.Distance

Core

Core Modules

Other Modules

This Page