- Preparing search index...
- The search index is not available
x4js
Constructors
constructor
- new Color(): Color
-
- new Color(value): Color
-
- new Color(value, alpha): Color
-
Parameters
-
value: string | number
-
alpha: number
- new Color(r, g, b): Color
-
Parameters
-
r: number
-
g: number
-
b: number
- new Color(r, g, b, a): Color
-
Parameters
-
r: number
-
g: number
-
b: number
-
a: number
Properties
Private
m_value
m_value: number
Methods
Private
_getCustomColor
- _getCustomColor(name): number
-
Returns number
Private
_split
- _split(): {
a: number;
b: number;
g: number;
r: number;
}
-
Returns {
a: number;
b: number;
g: number;
r: number;
}
-
a: number
-
b: number
-
g: number
-
r: number
alpha
- alpha(): number
-
Returns number
blue
- blue(): number
-
Returns number
green
- green(): number
-
Returns number
red
- red(): number
-
Returns number
toHex
- toHex(with_alpha?): string
-
Parameters
-
with_alpha: boolean = true
Returns string
toString
- toString(): string
-
Returns string
value
- value(): number
-
Returns number
Static
addCssColor
- addCssColor(name): void
-
Returns void
Static
addCustomColor
- addCustomColor(name, value): void
-
Returns void
Static
contrastColor
- contrastColor(color): Color
-
Static
fromCssVar
- fromCssVar(varName): string
-
Returns string
Static
fromHLS
- fromHLS(h, l, s): Color
-
Parameters
-
h: number
-
l: number
-
s: number
Static
fromHSV
- fromHSV(h, s, v, a?): Color
-
Parameters
-
h: number
-
s: number
-
v: number
-
a: number = 1
Static
toHLS
- toHLS(color): {
h: number;
l: number;
s: any;
}
-
Returns {
h: number;
l: number;
s: any;
}
-
h: number
-
l: number
-
s: any
Static
toHSV
- toHSV(c): {
a: number;
h: any;
s: number;
v: number;
}
-
Returns {
a: number;
h: any;
s: number;
v: number;
}
-
a: number
-
h: any
-
s: number
-
v: number
Static
valueFromColorName
- valueFromColorName(name): Color
-
Example