Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color defines a color value with red, green and blue component and an optional alpha. All values are in the 0..255 integer range.

Hierarchy

  • Color

Index

Constructors

constructor

  • new Color(red: int32, green: int32, blue: int32, alpha: int32): Color
  • Create a new color.

    Parameters

    • red: int32

      the red component of the color (0..255).

    • green: int32

      the green component of the color (0..255).

    • blue: int32

      the blue component of the color (0..255).

    • alpha: int32

      the alpha (transparency) component of the color (0..255, where 255 is opaque).

    Returns Color

Properties

alpha

alpha: int32

The alpha (transparency) component of the color (0..255, where 255 is opaque)

blue

blue: int32

The blue component of the color (0..255)

green

green: int32

The green component of the color (0..255)

red

red: int32

The red component of the color (0..255)

Static TYPE

TYPE: string = "O"

The type of objects in this class

Methods

toString

  • toString(): string
  • Convert the object to a string.

    Returns string

    the string form of the object.

toStringARGB

  • toStringARGB(): string
  • Convert the color to an A.R.G.B string.

    Returns string

    the string.

toStringRGB

  • toStringRGB(): string
  • Convert the color to an R.G.B string.

    Returns string

    the string.

toStringRGBA

  • toStringRGBA(): string
  • Convert the color to an R.G.B.A string.

    Returns string

    the string.

Static fromRGB

  • fromRGB(red: int32, green: int32, blue: int32): Color
  • Create a new RGB color.

    Parameters

    • red: int32

      the red component of the color (0..255).

    • green: int32

      the green component of the color (0..255).

    • blue: int32

      the blue component of the color (0..255).

    Returns Color

    the color.

Static fromRGBA

  • fromRGBA(red: int32, green: int32, blue: int32, alpha: int32): Color
  • Create a new RGBA color.

    Parameters

    • red: int32

      the red component of the color (0..255).

    • green: int32

      the green component of the color (0..255).

    • blue: int32

      the blue component of the color (0..255).

    • alpha: int32

      the alpha (transparency) component of the color (0..255, where 255 is opaque).

    Returns Color

    the color.