Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an RGBA color value for use in rendering operations.

Hierarchy

  • Color

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Color(red: number, green: number, blue: number, alpha?: number): Color
  • Construct a new Color object from the given RGBA values. All values must be in the range [0.0,1.0].

    Parameters

    • red: number

      The amount of red in the color.

    • green: number

      The amount of green in the color.

    • blue: number

      The amount of blue in the color.

    • Optional alpha: number

      Alpha (opacity). Defaults to 1.0.

    Returns Color

Properties

a

a: number

The value of the color's alpha component, representing its opacity. Use values less than 1.0 for translucency.

b

b: number

The value of the color's blue component.

g

g: number

The value of the color's green component.

name

name: string

The X11 name of the color for known colors, or else its HTML representation, e.g. #FF8080FF.

r

r: number

The value of the color's red component.

Static AliceBlue

AliceBlue: Color

Static AntiqueWhite

AntiqueWhite: Color

Static Aqua

Aqua: Color

Static Aquamarine

Aquamarine: Color

Static Azure

Azure: Color

Static Beige

Beige: Color

Static Bisque

Bisque: Color

Static Black

Black: Color

Static BlanchedAlmond

BlanchedAlmond: Color

Static Blue

Blue: Color

Static BlueViolet

BlueViolet: Color

Static Brown

Brown: Color

Static BurlyWood

BurlyWood: Color

Static CadetBlue

CadetBlue: Color

Static Chartreuse

Chartreuse: Color

Chartreuse. The best color with the best name.

Static Chocolate

Chocolate: Color

Static Coral

Coral: Color

Static CornflowerBlue

CornflowerBlue: Color

Static Cornsilk

Cornsilk: Color

Static Crimson

Crimson: Color

Static Cyan

Cyan: Color

Static DarkBlue

DarkBlue: Color

Static DarkCyan

DarkCyan: Color

Static DarkGoldenrod

DarkGoldenrod: Color

Static DarkGray

DarkGray: Color

Static DarkGreen

DarkGreen: Color

Static DarkKhaki

DarkKhaki: Color

Static DarkMagenta

DarkMagenta: Color

Static DarkOliveGreen

DarkOliveGreen: Color

Static DarkOrange

DarkOrange: Color

Static DarkOrchid

DarkOrchid: Color

Static DarkRed

DarkRed: Color

Static DarkSalmon

DarkSalmon: Color

Static DarkSeaGreen

DarkSeaGreen: Color

Static DarkSlateBlue

DarkSlateBlue: Color

Static DarkSlateGray

DarkSlateGray: Color

Static DarkTurquoise

DarkTurquoise: Color

Static DarkViolet

DarkViolet: Color

Static DeepPink

DeepPink: Color

Static DeepSkyBlue

DeepSkyBlue: Color

Static DimGray

DimGray: Color

Static DodgerBlue

DodgerBlue: Color

Static FireBrick

FireBrick: Color

Static FloralWhite

FloralWhite: Color

Static ForestGreen

ForestGreen: Color

Static Fuchsia

Fuchsia: Color

Static Gainsboro

Gainsboro: Color

Static GhostWhite

GhostWhite: Color

Static Gold

Gold: Color

Static Goldenrod

Goldenrod: Color

Static Gray

Gray: Color

Static Green

Green: Color

Static GreenYellow

GreenYellow: Color

Static Honeydew

Honeydew: Color

Static HotPink

HotPink: Color

Static IndianRed

IndianRed: Color

Static Indigo

Indigo: Color

Static Ivory

Ivory: Color

Static Khaki

Khaki: Color

Static Lavender

Lavender: Color

Static LavenderBlush

LavenderBlush: Color

Static LawnGreen

LawnGreen: Color

Static LemonChiffon

LemonChiffon: Color

Static LightBlue

LightBlue: Color

Static LightCoral

LightCoral: Color

Static LightCyan

LightCyan: Color

Static LightGoldenrodYellow

LightGoldenrodYellow: Color

Static LightGray

LightGray: Color

Static LightGreen

LightGreen: Color

Static LightPink

LightPink: Color

Static LightSalmon

LightSalmon: Color

Static LightSeaGreen

LightSeaGreen: Color

Static LightSkyBlue

LightSkyBlue: Color

Static LightSlateGray

LightSlateGray: Color

Static LightSteelBlue

LightSteelBlue: Color

Static LightYellow

LightYellow: Color

Static Lime

Lime: Color

Static LimeGreen

LimeGreen: Color

Static Linen

Linen: Color

Static Magenta

Magenta: Color

Static Maroon

Maroon: Color

Static MediumAquamarine

MediumAquamarine: Color

Static MediumBlue

MediumBlue: Color

Static MediumOrchid

MediumOrchid: Color

Static MediumPurple

MediumPurple: Color

Static MediumSeaGreen

MediumSeaGreen: Color

Static MediumSlateBlue

MediumSlateBlue: Color

Static MediumSpringGreen

MediumSpringGreen: Color

Static MediumTurquoise

MediumTurquoise: Color

Static MediumVioletRed

MediumVioletRed: Color

Static MidnightBlue

MidnightBlue: Color

Static MintCream

MintCream: Color

Static MistyRose

MistyRose: Color

Static Moccasin

Moccasin: Color

Static NavajoWhite

NavajoWhite: Color

Static Navy

Navy: Color

Static OldLace

OldLace: Color

Static Olive

Olive: Color

Static OliveDrab

OliveDrab: Color

Static Orange

Orange: Color

Static OrangeRed

OrangeRed: Color

Static Orchid

Orchid: Color

Static PaleGoldenrod

PaleGoldenrod: Color

Static PaleGreen

PaleGreen: Color

Static PaleTurquoise

PaleTurquoise: Color

Static PaleVioletRed

PaleVioletRed: Color

Static PapayaWhip

PapayaWhip: Color

Static PeachPuff

PeachPuff: Color

Static Peru

Peru: Color

Static Pink

Pink: Color

Pink. The color of eaty pigs. *MUNCH*

Static Plum

Plum: Color

Static PowderBlue

PowderBlue: Color

Static Purple

Purple: Color

Static PurwaBlue

PurwaBlue: Color

Static RebeccaPurple

RebeccaPurple: Color

Static Red

Red: Color

Static RosyBrown

RosyBrown: Color

Static RoyalBlue

RoyalBlue: Color

Static SaddleBrown

SaddleBrown: Color

Static Salmon

Salmon: Color

Static SandyBrown

SandyBrown: Color

Static SeaGreen

SeaGreen: Color

Static Seashell

Seashell: Color

Static Sienna

Sienna: Color

Static Silver

Silver: Color

Static SkyBlue

SkyBlue: Color

Static SlateBlue

SlateBlue: Color

Static SlateGray

SlateGray: Color

Static Snow

Snow: Color

Static SpringGreen

SpringGreen: Color

Static StankyBean

StankyBean: Color

Stanky Bean. The first color created and named by an AI.

Static SteelBlue

SteelBlue: Color

Static Tan

Tan: Color

Static Teal

Teal: Color

Static Thistle

Thistle: Color

Static Tomato

Tomato: Color

Static Transparent

Transparent: Color

Static Turquoise

Turquoise: Color

Static Violet

Violet: Color

Static Wheat

Wheat: Color

Static White

White: Color

Static WhiteSmoke

WhiteSmoke: Color

Static Yellow

Yellow: Color

Static YellowGreen

YellowGreen: Color

Methods

clone

fadeTo

  • fadeTo(alphaFactor: number): Color
  • Gets a new Color with the same RGB as this one but with its alpha multiplied by the given factor. Useful for implementing transitions.

    Parameters

    • alphaFactor: number

    Returns Color

Static is

  • Check if two Color objects are equivalent without regard to their alpha values.

    Parameters

    Returns boolean

Static mix

  • Get a new Color which is a 50/50 blend of the two given ones.

    Parameters

    Returns Color

  • Get a new Color which is a weighted average of the two given ones, using the given weighting factors.

    Parameters

    • color1: Color
    • color2: Color
    • w1: number
    • w2: number

    Returns Color

Static of

  • of(name: string): Color
  • Gets a Color corresponding to the specified color name which can be either HTML notation (e.g. #7FFF00) or an X11 color name such as chartreuse (case insensitive).

    Parameters

    • name: string

    Returns Color

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc