Class Color

Hierarchy

  • Color

Constructors

  • Example

    let c = new Color( 255, 255, 255, 0.2 );
    let d = new Color( "fff" );
    let e = new Color( "css:selection-color" );
    let f = new Color( "rgba(255,0,255,0.6)" );

    Returns Color

  • Parameters

    • value: string | number

    Returns Color

  • Parameters

    • value: string | number
    • alpha: number

    Returns Color

  • Parameters

    • r: number
    • g: number
    • b: number

    Returns Color

  • Parameters

    • r: number
    • g: number
    • b: number
    • a: number

    Returns Color

Properties

m_value: number
BLACK: Color = ...
NONE: Color = ...
WHITE: Color = ...
custom: Color[] = []

Methods

  • Parameters

    • name: string

    Returns number

  • split the color into it's base element r,g,b & a (!a 1-255)

    Returns {
        a: number;
        b: number;
        g: number;
        r: number;
    }

    • a: number
    • b: number
    • g: number
    • r: number
  • get the alpha value of the color

    Returns number

  • get the blue value of the color

    Returns number

  • get the green value of the color

    Returns number

  • get the red value of the color

    Returns number

  • Parameters

    • with_alpha: boolean = true

    Returns string

  • convert the color into string value

    Returns string

  • Parameters

    • name: string

    Returns void

  • Parameters

    • name: string
    • value: Color

    Returns void

  • Parameters

    • varName: string

    Returns string

  • mix 2 colors

    Example

    let clr = Color.mix( color1, color2, 0.5 );
    

    Parameters

    Returns Color

  • Parameters

    Returns {
        h: number;
        l: number;
        s: any;
    }

    • h: number
    • l: number
    • s: any
  • Parameters

    Returns {
        a: number;
        h: any;
        s: number;
        v: number;
    }

    • a: number
    • h: any
    • s: number
    • v: number

Generated using TypeDoc