Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a color instance. It can be read in different formats. It manages transparency. Exposes static methods to create an instance of Color from an existing string (hex, rgb, rgba)

Hierarchy

  • Color

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

  • new Color(r: number, g: number, b: number, a?: number): Color

Properties

color: RgbaColor

Accessors

  • get alpha(): number
  • get blue(): number
  • get green(): number
  • get red(): number

Methods

  • hex(): string
  • rgb(): string
  • rgba(): string
  • Creates a Color instance from an HEX color string.

    Parameters

    • hex: string

      HEX string.

    Returns IColor

    a Color instance from HEX string.

  • Creates a Color instance from an RGB(A) color string.

    Parameters

    • rgb: string

      RGB(A) string.

    Returns IColor

    a Color instance from RGB(A) string.

Generated using TypeDoc