pymel.core.datatypes.Color

digraph inheritanceb81d2806bf {
rankdir=TB;
ranksep=0.15;
nodesep=0.15;
size="8.0, 12.0";
  "Color" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="#pymel.core.datatypes.Color",style="setlinewidth(0.5)",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)"];
  "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)",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)"];
  "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];
  "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)",height=0.25,shape=box,fontsize=8];
  "Array" -> "VectorN" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "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)",height=0.25,shape=box,fontsize=8];
}

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