@kismet.ts/core / Exports / KismetColor
Class: KismetColor
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new KismetColor(options?
)
Parameters
Name | Type |
---|---|
options? | Object |
options.A | number |
options.B | number |
options.G | number |
options.R | number |
Defined in
Properties
A
• A: number
Defined in
B
• B: number
Defined in
G
• G: number
Defined in
MAX_COLOR_VALUE
• MAX_COLOR_VALUE: number
Defined in
MIN_COLOR_VALUE
• MIN_COLOR_VALUE: number
Defined in
R
• R: number
Defined in
Methods
_validateNumber
▸ Private
_validateNumber(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
_validateOptions
▸ Private
_validateOptions(options
): void
Parameters
Name | Type |
---|---|
options | Record <string , number > |
Returns
void
Defined in
setColor
▸ setColor(type
, value
): KismetColor
Parameters
Name | Type |
---|---|
type | "R" | "G" | "B" | "A" |
value | number |
Returns
Defined in
setColors
▸ setColors(colors
): KismetColor
Parameters
Name | Type |
---|---|
colors | [number , number , number , number ] |
Returns
Defined in
setHexColor
▸ setHexColor(hexColor
, alpha?
): KismetColor
Parameters
Name | Type | Default value |
---|---|---|
hexColor | `#${string}` | undefined |
alpha | number | 1 |
Returns
Defined in
toString
▸ toString(): string
Returns
string
Defined in
hexToRgba
▸ Static
hexToRgba(hex
, alpha?
): [number
, number
, number
, number
]
Parameters
Name | Type | Default value |
---|---|---|
hex | `#${string}` | undefined |
alpha | number | 1 |
Returns
[number
, number
, number
, number
]