Constructors
constructor
- new Color(r?: number, g?: number, b?: number, a?: number): Color
-
Parameters
-
r: number = 1
-
g: number = 1
-
b: number = 1
-
a: number = 1
Methods
copyWithAlpha
- copyWithAlpha(a: number): Color
-
set
- set(r: number, g: number, b: number, a: number): Color
-
Parameters
-
r: number
-
g: number
-
b: number
-
a: number
setAlpha
- setAlpha(a: number): Color
-
setFromHash
- setFromHash(colorCode: string): Color
-
toHash
- toHash(withAlpha?: boolean): string
-
Parameters
-
withAlpha: boolean = false
Returns string
toIntArray
- toIntArray(): [number, number, number, number]
-
Returns [number, number, number, number]
toNumber
- toNumber(): number
-
Returns number
Static
fromHash
- fromHash(colorCode: string): Color
-
Static
intArrayToNumber
- intArrayToNumber(rgbaArray: [number, number, number, number]): number
-
Parameters
-
rgbaArray: [number, number, number, number]
Returns number
Static
interpolateLinearHSV
- interpolateLinearHSV(target: Color, c1: Color, c2: Color, t: number): void
-
Returns void
RGBA color value