Classdesc

A color class, inspired by neolitec's Javascript class. Original found at https://gist.github.com/neolitec/1344610 Thanks to neolitec

Constructors

Properties

a: number

Member

Memberof

Color

Instance

b: number

Member

Memberof

Color

Instance

g: number

Member

Memberof

Color

Instance

h: number

Member

Memberof

Color

Instance

l: number

Member

Memberof

Color

Instance

r: number

Member

Memberof

Color

Instance

s: number

Member

Memberof

Color

Instance

Converter: {
    HSLToRGB: ((color) => void);
    RGBToHSL: ((color) => void);
    hue2rgb: ((p, q, t) => number);
} = ...

Type declaration

Sanitizer: {
    HSL: ((...args) => number[]);
    RGB: ((...args) => number[]);
} = ...

Type declaration

  • HSL: ((...args) => number[])
      • (...args): number[]
      • Parameters

        • Rest ...args: (string | number)[]

        Returns number[]

  • RGB: ((...args) => number[])
      • (...args): number[]
      • Parameters

        • Rest ...args: any[]

        Returns number[]

Validator: {
    checkHEX: ((value) => void);
} = ...

Type declaration

  • checkHEX: ((value) => void)

    Check a hexa color (without #)

      • (value): void
      • Parameters

        • value: string

        Returns void

Methods

  • Get the blue component of this RGB(A) color. This method just returns the b color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    blue

    Instance

    Memberof

    Color

  • Get this color as a CSS-HEX string (non-alpha): #rrggbb

    Returns string

    This color as a CSS-HEX string.

    Method

    cssHEX

    Instance

    Memberof

    Color

  • Get the green component of this RGB(A) color. This method just returns the g color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    green

    Instance

    Memberof

    Color

  • Get the hue component of this HSL(A) color. This method just returns the h color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    hue

    Instance

    Memberof

    Color

  • Interpolate this color on the RGB scale.

    Parameters

    • c: Color

      The color to interpolate to.

    • t: number

      An interpolation value between 0.0 and 1.0.

    Returns Color

    A clone of this color (in RGB mode).

    Method

    interpolate

    Instance

    Memberof

    Color

  • Get the lightness component of this HSL(A) color. This method just returns the l color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    lightness

    Instance

    Memberof

    Color

  • Get the red component of this RGB(A)color. This method just returns the r color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    red

    Instance

    Memberof

    Color

  • Get the saturation component of this HSL(A) color. This method just returns the s color attribute.

    Returns number

    A value between 0.0 and 1.0.

    Method

    saturation

    Instance

    Memberof

    Color

  • Parse the given color string. Currently only these formate are recognized: hex, rgb, rgba.

    Parameters

    • str: string

      The string representation to parse.

    Returns Color

    The color instance that's represented by the given string.

    Method

    parse

    Static

    Memberof

    Color

Generated using TypeDoc