Colour

Represents an RGBA colour. Note that colour each component is 8-bit (ie. must be between 0 and 255).

Properties

Property Type Description
r number Red component
g number Green component
b number Blue component
a number Alpha component (transparency)

Constructors

new ( )
Creates a new colour with all components set to 0.

new ( number r, number g, number b )
Creates a new colour with the given r, g and b components. The a component is set to 255.

new ( number r, number g, number b, number a )
Creates a new colour with the given r, g, b and a components.