Rgb

Rgb

{Object} Rgb RGB color model

Constructor

new Rgb(red, green, blue, alpha)

Description:
  • Create an RGB color model
Source:
Properties:
Name Type Attributes Default Description
red number <optional>
0 Red value; 0 - 255
green number <optional>
0 Green value; 0 - 255
blue number <optional>
0 Blue value; 0 - 255
alpha number <optional>
1 Alpha value; 0 - 1 (decimal)
Parameters:
Name Type Description
red number Red value
green number Green value
blue number Blue value
alpha number Alpha value

Methods

alpha(value)

Description:
  • Set alpha value
Source:
See:
Parameters:
Name Type Description
value number Alpha value; 0 - 1

alpha() → {number}

Description:
  • Set alpha value
Source:
See:
Returns:
Alpha value; 0 - 1
Type
number

blue(blue)

Description:
  • Sets the blue value
Source:
Parameters:
Name Type Description
blue number Blue value; 0 - 255

blue() → {number}

Description:
  • Gets the blue value
Source:
Returns:
Blue value; 0 - 255
Type
number

cycle(start, end, progress, max)

Description:
  • Color cycling
Source:
Parameters:
Name Type Description
start Rgb Color model & values
end Rgb Color model & values
progress number Progress time unit; 0.00 - 1.00
max number Maximum number of steps between interpolation

green(green)

Description:
  • Sets the green value
Source:
Parameters:
Name Type Description
green number Green value; 0 - 255

green() → {number}

Description:
  • Gets the green value
Source:
Returns:
Green value; 0 - 255
Type
number

red(red)

Description:
  • Sets the red value
Source:
Parameters:
Name Type Description
red number Red value; 0 - 255

red() → {number}

Description:
  • Gets the red value
Source:
Returns:
Red value; 0 - 255
Type
number

toCss() → {string}

Description:
  • Returns a CSS compatible string value
Source:
Returns:
CSS string
Type
string