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