Options
All
  • Public
  • Public/Protected
  • All
Menu

Colors are represented by percents red, green, and blue.

These percentages are expressed as values between 0.0 and 1.0.

Black is red: 0, green: 0, blue: 0. White is red: 1, green: 1, blue: 1.

You can use Color objects to fill shapes and create Strokes (outlines) of different colors.

Hierarchy

  • Color

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Color(red?: number, green?: number, blue?: number): Color
  • Parameters

    • Optional red: number

      percent red (between 0.0 and 1.0)

    • Optional green: number

      percent green (between 0.0 and 1.0)

    • Optional blue: number

      percent blue (between 0.0 and 1.0)

    Returns Color

Properties

Static BLACK

BLACK: Color = new Color()

A constant referring to the color black RGB(0, 0, 0)

Static WHITE

WHITE: Color = new Color(1, 1, 1)

A constant referring to the color white RGB(1, 1, 1)

Methods

toRGB

  • toRGB(): string
  • Generates a string representation of the color that can be used in HTML and SVG style attributes.

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • 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