Color
Type Aliases
Section titled “Type Aliases”SerializedColor
Section titled “SerializedColor”SerializedColor =
Readonly<LuaMap<string,unknown>> &object
Defined in: packages/isaacscript-common/src/functions/color.ts:14
Type Declaration
Section titled “Type Declaration”__serializedColorBrand
Section titled “__serializedColorBrand”
readonly__serializedColorBrand:symbol
__kind
Section titled “__kind”
readonly__kind:CopyableIsaacAPIClassType.COLOR
Functions
Section titled “Functions”colorEquals()
Section titled “colorEquals()”colorEquals(
color1,color2):boolean
Defined in: packages/isaacscript-common/src/functions/color.ts:22
Parameters
Section titled “Parameters”color1
Section titled “color1”Color
color2
Section titled “color2”Color
Returns
Section titled “Returns”boolean
copyColor()
Section titled “copyColor()”copyColor(
color):Color
Defined in: packages/isaacscript-common/src/functions/color.ts:27
Helper function to copy a Color Isaac API class.
Parameters
Section titled “Parameters”Color
Returns
Section titled “Returns”Color
deserializeColor()
Section titled “deserializeColor()”deserializeColor(
color):Color
Defined in: packages/isaacscript-common/src/functions/color.ts:49
Helper function to convert a SerializedColor object to a normal Color object. (This is used
by the save data manager when reading data from the “save#.dat” file.)
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Color
getRandomColor()
Section titled “getRandomColor()”getRandomColor(
seedOrRNG,alpha?):Readonly<Color>
Defined in: packages/isaacscript-common/src/functions/color.ts:89
Helper function to get a random Color object.
If you want to generate an unseeded object, you must explicitly pass undefined to the
seedOrRNG parameter.
Parameters
Section titled “Parameters”seedOrRNG
Section titled “seedOrRNG”RNG | Seed | undefined
The Seed or RNG object to use. If an RNG object is provided, the
RNG.Next method will be called. If undefined is provided, it will default to
a random seed.
alpha?
Section titled “alpha?”number = 1
Optional. The alpha value to use. Default is 1.
Returns
Section titled “Returns”Readonly<Color>
isColor()
Section titled “isColor()”isColor(
object):object is Color
Defined in: packages/isaacscript-common/src/functions/color.ts:103
Helper function to check if something is an instantiated Color object.
Parameters
Section titled “Parameters”object
Section titled “object”unknown
Returns
Section titled “Returns”object is Color
isSerializedColor()
Section titled “isSerializedColor()”isSerializedColor(
object):object is SerializedColor
Defined in: packages/isaacscript-common/src/functions/color.ts:111
Used to determine is the given table is a serialized Color object created by the deepCopy
function.
Parameters
Section titled “Parameters”object
Section titled “object”unknown
Returns
Section titled “Returns”object is SerializedColor
serializeColor()
Section titled “serializeColor()”serializeColor(
color):SerializedColor
Defined in: packages/isaacscript-common/src/functions/color.ts:123
Helper function to convert a Color object to a SerializedColor object. (This is used by the
save data manager when writing data from the “save#.dat” file.)
Parameters
Section titled “Parameters”Color
