panda3d.core.ColorAttrib

from panda3d.core import ColorAttrib
class ColorAttrib

Bases: RenderAttrib

Indicates what color should be applied to renderable geometry.

Inheritance diagram

Inheritance diagram of ColorAttrib

enum Type
enumerator T_vertex = 0
enumerator T_flat = 1
enumerator T_off = 2
property class_slot
Return type

int

property color

If the type is T_flat or T_off, this returns the color that will be applied to geometry. If the type is T_vertex, this is meaningless.

Return type

LColor

property color_type

Returns the type of color specified by this ColorAttrib. The options are:

T_vertex - use the vertex color specified in the geometry itself.

T_flat - use the color specified in this ColorAttrib for all geometry. You can get this color via getColor().

T_off - use the color white.

Return type

Type

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

getColor() → LColor

If the type is T_flat or T_off, this returns the color that will be applied to geometry. If the type is T_vertex, this is meaningless.

Return type

LColor

getColorType() → Type

Returns the type of color specified by this ColorAttrib. The options are:

T_vertex - use the vertex color specified in the geometry itself.

T_flat - use the color specified in this ColorAttrib for all geometry. You can get this color via getColor().

T_off - use the color white.

Return type

Type

static makeDefault() → RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Return type

RenderAttrib

static makeFlat(color: LColor) → RenderAttrib

Constructs a new ColorAttrib object that indicates geometry should be rendered in the indicated color.

Return type

RenderAttrib

static makeOff() → RenderAttrib

Constructs a new ColorAttrib object that indicates geometry should be rendered in white.

Return type

RenderAttrib

static makeVertex() → RenderAttrib

Constructs a new ColorAttrib object that indicates geometry should be rendered according to its own vertex color.

Return type

RenderAttrib