colors — Wrapper class for colors

Color reference

Constructor:

class colors.Color(r=0.0, g=0.0, b=0.0, a=1.0)

A Color represents a color in RGBA format. Color is a property attribute of a nodes.Node instance and all its subclasses e.g. physics.BodyNode, physics.BodyNode, fonts.TextNode etc.

Giving nodes.Node a color tints this node’s geometry.Shape in that color. In case of text nodes it sets the color of the text.

Parameters r, g, b and a are red, green, blue and alpha. They take values between 0 and 1.

Instance properties (read only):

Color.r

Returns red value

Color.g

Returns green value

Color.b

Returns blue value

Color.a

Returns blue value

Class methods:

classmethod Color.from_int(r=0, g=0, b=0, a=0)

Allows to construct a Color instance from integer parameters: r, g, b and a must be integers between 0 and 255