Home Reference Source Test
public class | source

Color

A color with r, g, b, a values between 0 and 1.

Contains instatiation functions for creating default colors without explicitly defining the values.

Static Method Summary

Static Public Methods
public static

blue(): *

Returns a new color with the color blue.

public static

green(): *

Returns a new color with the color green.

public static

pink(): *

Returns a new color with the color pink.

public static

red(): *

Returns a new color with the color red.

Constructor Summary

Public Constructor
public

Builds a color into an array for easy access for WebGL.

Member Summary

Public Members
public

Method Summary

Public Methods
public

minmax(val: *, min: number, max: number): *

public

set(r: number, g: number, b: number, a: number)

Static Public Methods

public static blue(): * source

Returns a new color with the color blue. Value: #0000FF with alpha 1.

Return:

*

public static green(): * source

Returns a new color with the color green. Value: #00FF00 with alpha 1.

Return:

*

public static pink(): * source

Returns a new color with the color pink. Value: #FF1493 with alpha 1.

Return:

*

public static red(): * source

Returns a new color with the color red. Value: #FF0000 with alpha 1.

Return:

*

Public Constructors

public constructor(r: number, g: number, b: number, a: number) source

Builds a color into an array for easy access for WebGL.

Params:

NameTypeAttributeDescription
r number

Red value between 0 - 1

g number

Green value between 0 - 1

b number

Blue value between 0 - 1

a number

Alpha value between 0 - 1

Public Members

public color: undefined[] source

Public Methods

public minmax(val: *, min: number, max: number): * source

Params:

NameTypeAttributeDescription
val *
min number
  • optional
  • default: 0
max number
  • optional
  • default: 1

Return:

*

public set(r: number, g: number, b: number, a: number) source

Params:

NameTypeAttributeDescription
r number

Red value between 0 - 1. Defaults to previous value.

g number

Green value between 0 - 1. Defaults to previous value.

b number

Blue value between 0 - 1. Defaults to previous value.

a number

Alpha value between 0 - 1. Defaults to previous value.