Class Color

A class for color manipulation.

Hierarchy

  • Color

Constructors

Properties

a b g r

Accessors

Methods

Constructors

Properties

a: number = 1

The alpha component of the color (opacity).

Ranges from 0 to 1.

b: number = 0

The blue component of the color.

g: number = 0

The green component of the color.

r: number = 0

The red component of the color.

Accessors

  • get rgba(): ColorArray
  • Get the RGB value of the color as an array of integers.

    Returns ColorArray

  • set rgba(__namedParameters): void
  • Set the RGB value of the color as an array of integers.

    Parameters

    • __namedParameters: ColorArray

    Returns void

Methods

  • Convert the color to an hexademical string.

    Example

    `#f6d26a`
    

    Parameters

    • Optional noHashtag: boolean

      Wether to not include the # character in the string.

    Returns string

  • Convert the color to a rgb(...) css string.

    Example

    `rgb(250, 30, 124)`
    

    Returns string

  • Convert the color to a rgba(...) css string.

    Example

    `rgba(250, 30, 124, 0.5)`
    

    Returns string

Generated using TypeDoc