DuAEF.DuJS.Color

Color related methods

Members

static, readonly Colors :Array.<float>

Enum for predefined colors.
Properties:
Name Type Description
BLACK Array.<float>
VERY_DARK_GREY Array.<float>
DARK_GREY Array.<float>
LIGHT_GREY Array.<float>
VERY_LIGHT_GREY Array.<float>
RAINBOX_RED Array.<float>
ORANGE Array.<float>
YELLOW Array.<float>
GREEN Array.<float>
LIGHT_BLUE Array.<float>
LIGHT_PURPLE Array.<float>
AFTER_EFFECTS_BLUE Array.<float>
RAINBOX_PURPLE Array.<float>
RANDOM Array.<float>

Methods

static hexToRGB(hexColor, isStringopt) → {Array.<float>}

Converts an hexadecimal color to an RVB Array
Parameters:
Name Type Attributes Default Description
hexColor string | Array.<int> The hexadecimal color
isString boolean <optional>
true Whether hexColor is a string or an Array of int of base 16
Returns:
Array.<float> - The color as an [R,G,B,A] Array with float values between 0.0 and 1.0

static random() → {Array.<float>}

Generates a random color
Returns:
Array.<float> - The color as an [R,G,B,A] Array with float values between 0.0 and 1.0

static rgbToHex(rgbColor) → {string}

Converts an RGB color to a hex string
Parameters:
Name Type Description
rgbColor Array.<float> The rgb color
Returns:
string - The color as an hex string