Class

Color

Color(r, g, b, aopt)

A color

Constructor

new Color(r, g, b, aopt)

Constructor
Parameters:
Name Type Attributes Default Description
r number Red color in the range [0-255]
g number Green color in the range [0-255]
b number Blue color in the range [0-255]
a number <optional>
1 Opacity in the range [0-255]

View Source Color.js, line 6

Members

number

a

Opacity in the range [0-1]

View Source Color.js, line 46

number

b

Red color in the range [0-1]

View Source Color.js, line 38

number

g

Green color in the range [0-1]

View Source Color.js, line 30

number

r

Red color in the range [0-1]

View Source Color.js, line 22

Methods

isEqual(color) → {boolean}

Check if the given Color instance is equal to this one
Parameters:
Name Type Description
color Color A Color instance

View Source Color.js, line 70

True if the two colors are equals, otherwise false
boolean

set(r, g, b, aopt)

Set color
Parameters:
Name Type Attributes Default Description
r number Red color in the range [0-255]
g number Green color in the range [0-255]
b number Blue color in the range [0-255]
a number <optional>
1 Opacity in the range [0-255]

View Source Color.js, line 57