Class Color

Tutorial

colors

Hierarchy

  • Color

Constructors

Properties

Methods

  • Gets value of alpha channel for this color

    Returns number

    0-1

  • Sets value of alpha channel for this color

    Parameters

    • alpha: number

      Alpha value 0-1

    Returns Color

    thisArg

  • Sets source of this color (where source is an array representation; ex: [200, 200, 100, 1])

    Parameters

    Returns void

  • Transforms color to its black and white representation

    Parameters

    • threshold: number

    Returns Color

    thisArg

  • Returns color representation in HEX format

    Returns string

    ex: FF5555

  • Returns color representation in HEXA format

    Returns string

    ex: FF5555CC

  • Returns color representation in HSL format

    Returns string

    ex: hsl(0-360,0%-100%,0%-100%)

  • Returns color representation in HSLA format

    Returns string

    ex: hsla(0-360,0%-100%,0%-100%,0-1)

  • Returns color representation in RGB format

    Returns string

    ex: rgb(0-255,0-255,0-255)

  • Returns color representation in RGBA format

    Returns string

    ex: rgba(0-255,0-255,0-255,0-1)

  • Returns new color object, when given a color in HEX format

    Parameters

    • color: string

      Color value ex: FF5555

    Returns Color

    Static

    Member Of

    Color

  • Returns new color object, when given a color in HSL format

    Parameters

    • color: string

      Color value ex: hsl(0-260,0%-100%,0%-100%)

    Returns Color

    Member Of

    Color

  • Returns new color object, when given a color in HSLA format

    Parameters

    • color: string

    Returns Color

    Static

    Function

    Member Of

    Color

  • Returns new color object, when given a color in RGB format

    Parameters

    • color: string

      Color value ex: rgb(0-255,0-255,0-255)

    Returns Color

    Member Of

    Color

  • Returns new color object, when given a color in RGBA format

    Parameters

    • color: string

    Returns Color

    Static

    Function

    Member Of

    Color

  • Returns array representation (ex: [100, 100, 200, 1]) of a color that's in HEX format

    Parameters

    • color: string

      ex: FF5555 or FF5544CC (RGBa)

    Returns undefined | TRGBAColorSource

    source

    Static

    Member Of

    Color

  • Returns array representation (ex: [100, 100, 200, 1]) of a color that's in RGB or RGBA format

    Parameters

    • color: string

      Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%)

    Returns undefined | TRGBAColorSource

    source

    Member Of

    Color

Generated using TypeDoc