# Class: Color
# Table of contents
# Constructors
# Properties
# Accessors
# Methods
- clone
- equals
- mix
- set
- setRGBA
- setValue32
- toNormalizedArray
- toRGBAString
- blendColorHex
- diffc
- fromFloatArray
- fromHex
- fromHexString
- getValue32FromHSVA
- getValue32FromRGBA
- hsvV2rgb
- multiplyColorHex
- percentRoundFn
- randomMix
- rgb2hsv
# Constructors
# constructor
• new Color(r?
, g?
, b?
, a?
)
# Parameters
Name | Type |
---|---|
r? | number |
g? | number |
b? | number |
a? | number |
# Properties
# BlendType
▪ Static
BlendType: typeof BlendType
# Accessors
# a
• get
a(): number
# Returns
number
• set
a(val
): void
# Parameters
Name | Type |
---|---|
val | number |
# Returns
void
# b
• get
b(): number
# Returns
number
• set
b(val
): void
# Parameters
Name | Type |
---|---|
val | number |
# Returns
void
# g
• get
g(): number
# Returns
number
• set
g(val
): void
# Parameters
Name | Type |
---|---|
val | number |
# Returns
void
# r
• get
r(): number
# Returns
number
• set
r(val
): void
# Parameters
Name | Type |
---|---|
val | number |
# Returns
void
# BLACK
• Static
get
BLACK(): Color
# Returns
# TRANSPARENT
• Static
get
TRANSPARENT(): Color
# Returns
# WHITE
• Static
get
WHITE(): Color
# Returns
# Methods
# clone
▸ clone(): Color
# Returns
# equals
▸ equals(target
): boolean
# Parameters
Name | Type |
---|---|
target | Color |
# Returns
boolean
# mix
▸ mix(color
, dst?
): Color
# Parameters
# Returns
# set
▸ set(val
): void
# Parameters
Name | Type |
---|---|
val | Color |
# Returns
void
# setRGBA
▸ setRGBA(r
, g
, b
, a
): void
# Parameters
Name | Type |
---|---|
r | number |
g | number |
b | number |
a | number |
# Returns
void
# setValue32
▸ setValue32(v32
): void
# Parameters
Name | Type |
---|---|
v32 | number |
# Returns
void
# toNormalizedArray
▸ toNormalizedArray(): [number
, number
, number
, number
]
# Returns
[number
, number
, number
, number
]
# toRGBAString
▸ toRGBAString(): string
# Returns
string
# blendColorHex
▸ Static
blendColorHex(colorHexA
, colorHexB
, type?
): number
# Parameters
Name | Type |
---|---|
colorHexA | number |
colorHexB | number |
type | BlendType |
# Returns
number
# diffc
▸ Static
diffc(v
, c
, diff
): number
# Parameters
Name | Type |
---|---|
v | number |
c | number |
diff | number |
# Returns
number
# fromFloatArray
▸ Static
fromFloatArray(arr
): Color
# Parameters
Name | Type |
---|---|
arr | number [] |
# Returns
# fromHex
▸ Static
fromHex(hex
): Color
# Parameters
Name | Type |
---|---|
hex | number |
# Returns
# fromHexString
▸ Static
fromHexString(hexString
): Color
# Parameters
Name | Type |
---|---|
hexString | string |
# Returns
# getValue32FromHSVA
▸ Static
getValue32FromHSVA(): void
# Returns
void
# getValue32FromRGBA
▸ Static
getValue32FromRGBA(r
, g
, b
, a
): number
# Parameters
Name | Type |
---|---|
r | number |
g | number |
b | number |
a | number |
# Returns
number
# hsvV2rgb
▸ Static
hsvV2rgb(h
, s
, v
, dst?
): Vector3
# Parameters
Name | Type |
---|---|
h | number |
s | number |
v | number |
dst? | Vector3 |
# Returns
# multiplyColorHex
▸ Static
multiplyColorHex(colorHexA
, colorHexB
, type?
): number
# Parameters
Name | Type |
---|---|
colorHexA | number |
colorHexB | number |
type | BlendType |
# Returns
number
# percentRoundFn
▸ Static
percentRoundFn(num
): number
# Parameters
Name | Type |
---|---|
num | number |
# Returns
number
# randomMix
▸ Static
randomMix(colorHexA
, colorHexB
, randomSeed?
): number
# Parameters
Name | Type |
---|---|
colorHexA | number |
colorHexB | number |
randomSeed | number |
# Returns
number
# rgb2hsv
▸ Static
rgb2hsv(r
, g
, b
, dst?
): Vector3
# Parameters
Name | Type |
---|---|
r | number |
g | number |
b | number |
dst? | Vector3 |