pymel.core.datatypes.Color¶
digraph inheritanceb81d2806bf { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "Array" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.arrays/pymel.util.arrays.Array.html#pymel.util.arrays.Array",style="setlinewidth(0.5)",tooltip="A generic n-dimensional array class using nested lists for storage.",height=0.25,shape=box,fontsize=8]; "Color" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.datatypes.Color",style="setlinewidth(0.5)",tooltip="A 4 dimensional vector class that wraps Maya's api Color class,",height=0.25,shape=box,fontsize=8]; "Vector" -> "Color" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MColor" -> "Color" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MColor" [shape=box,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=8,style="setlinewidth(0.5)",height=0.25]; "MVector" [shape=box,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=8,style="setlinewidth(0.5)",height=0.25]; "Vector" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.datatypes.Vector.html#pymel.core.datatypes.Vector",style="setlinewidth(0.5)",tooltip="A 3 dimensional vector class that wraps Maya's api Vector class",height=0.25,shape=box,fontsize=8]; "VectorN" -> "Vector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MVector" -> "Vector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "VectorN" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.arrays/pymel.util.arrays.VectorN.html#pymel.util.arrays.VectorN",style="setlinewidth(0.5)",tooltip="A generic size VectorN class derived from Array, basically a 1 dimensional Array.",height=0.25,shape=box,fontsize=8]; "Array" -> "VectorN" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
- 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'))¶
- __add__(other)¶
c.__add__(d) <==> c+d Returns the result of the addition of MColors c and d if d is convertible to a Color, adds d to every component of c if d is a scalar
- __iadd__(other)¶
c.__iadd__(d) <==> c += d In place addition of c and d, see __add__
- __imul__(other)¶
a.__imul__(b) <==> a *= b In place multiplication of VectorN a and b, see __mul__, result must fit a’s type
- __isub__(other)¶
c.__isub__(d) <==> c -= d In place substraction of d from c, see __sub__
- __melobject__()¶
Special method for returning a mel-friendly representation. In this case, a 3-component color (RGB)
- __mul__(other)¶
a.__mul__(b) <==> a*b If b is a 1D sequence (Array, VectorN, Color), __mul__ is mapped to element-wise multiplication, If b is a MatrixN, __mul__ is similar to Point a by MatrixN b multiplication (post multiplication or transformation of a by b), multiplies every component of a by b if b is a single numeric value
- __radd__(other)¶
c.__radd__(d) <==> d+c Returns the result of the addition of MColors c and d if d is convertible to a Color, adds d to every component of c if d is a scalar
- __rmul__(other)¶
a.__rmul__(b) <==> b*a If b is a 1D sequence (Array, VectorN, Color), __mul__ is mapped to element-wise multiplication, If b is a MatrixN, __mul__ is similar to MatrixN b by Point a matrix multiplication, multiplies every component of a by b if b is a single numeric value
- __rsub__(other)¶
c.__rsub__(d) <==> d-c Returns the result of the substraction of Color c from d if d is convertible to a Color, replace every component c[i] of c by d-c[i] if d is a scalar
- __sub__(other)¶
c.__add__(d) <==> c+d Returns the result of the substraction of Color d from c if d is convertible to a Color, substract d from every component of c if d is a scalar
- 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])¶