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

a
apicls

alias of MColor

b
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

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)
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
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

v

The v Color component

Previous topic

pymel.core.datatypes.BoundingBox

Next topic

pymel.core.datatypes.Distance

Core

Core Modules

Other Modules

This Page