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

  • 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