Options
All
  • Public
  • Public/Protected
  • All
Menu

A color described by it's red, blue and green values.

Hierarchy

  • RGBColor

Implements

Index

Constructors

constructor

  • new RGBColor(r: number, g: number, b: number): RGBColor
  • Parameters

    • r: number

      value between 0 and 255

    • g: number

      value between 0 and 255

    • b: number

      value between 0 and 255

    Returns RGBColor

Methods

add

dim

  • Dim the color by a certain amount.

    Parameters

    • brightness: number

      a value between 0-1, where 0 dims the colour to black, and 1 keeps it at the current value

    Returns RGBColor

equals

  • equals(other: Color): boolean

json

overlay

  • Overlay another color ontop of this one with a certain opacity

    Parameters

    • other: RGBColor

      the color you with to overlay over this one

    • opacity: number

      value between 0 and 1, the amount you wish to overlay this color.

    Returns RGBColor

toString

  • toString(): string

transition

  • Produce a new color that is mid way between this color and another

    Parameters

    • other: RGBColor

      the color you to transition to

    • amount: number

      value between 0 and 1, how far the transition has progressed

    Returns RGBColor

Generated using TypeDoc