Hex
Functions
hexToColor
▸ hexToColor(hexString
, alpha?
): Readonly
<Color
>
Converts a hex string like "#33aa33" to a KColor object.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
hexString | string | undefined | A hex string like "#ffffff" or "ffffff". (The "#" character is optional.) |
alpha | number | 1 | Optional. Range is from 0 to 1. Default is 1. (The same as the Color constructor.) |
Returns
Readonly
<Color
>
Defined in
packages/isaacscript-common/src/functions/hex.ts:11
hexToKColor
▸ hexToKColor(hexString
, alpha?
): Readonly
<KColor
>
Converts a hex string like "#33aa33" to a Color object.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
hexString | string | undefined | A hex string like "#ffffff" or "ffffff". (The "#" character is optional.) |
alpha | number | 1 | Range is from 0 to 1. Default is 1. |
Returns
Readonly
<KColor
>