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
static int get_class_slot(void)
static TypeHandle get_class_type(void)
LColor const &get_color(void) const

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.

Type get_color_type(void) const

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 get_color().

T_off - use the color white.

static ConstPointerTo<RenderAttrib> make_default(void)

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

static ConstPointerTo<RenderAttrib> make_flat(LColor const &color)

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

static ConstPointerTo<RenderAttrib> make_off(void)

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

static ConstPointerTo<RenderAttrib> make_vertex(void)

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