Color
Type Aliases
SerializedColor
Ƭ SerializedColor: LuaMap
<string
, unknown
> & { __serializedColorBrand
: symbol
; __kind
: CopyableIsaacAPIClassType.COLOR
}
Defined in
packages/isaacscript-common/src/functions/color.ts:14
Functions
colorEquals
▸ colorEquals(color1
, color2
): boolean
Parameters
Name | Type |
---|---|
color1 | Color |
color2 | Color |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/color.ts:22
copyColor
▸ copyColor(color
): Color
Helper function to copy a Color
Isaac API class.
Parameters
Name | Type |
---|---|
color | Color |
Returns
Color
Defined in
packages/isaacscript-common/src/functions/color.ts:27
deserializeColor
▸ deserializeColor(color
): Color
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
Name | Type |
---|---|
color | SerializedColor |
Returns
Color
Defined in
packages/isaacscript-common/src/functions/color.ts:49
getRandomColor
▸ getRandomColor(seedOrRNG
, alpha?
): Readonly
<Color
>
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
Name | Type | Default value | Description |
---|---|---|---|
seedOrRNG | undefined | 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 | number | 1 | Optional. The alpha value to use. Default is 1. |
Returns
Readonly
<Color
>
Defined in
packages/isaacscript-common/src/functions/color.ts:89
isColor
▸ isColor(object
): object is Color
Helper function to check if something is an instantiated Color
object.
Parameters
Name | Type |
---|---|
object | unknown |
Returns
object is Color
Defined in
packages/isaacscript-common/src/functions/color.ts:103
isSerializedColor
▸ isSerializedColor(object
): object is SerializedColor
Used to determine is the given table is a serialized Color
object created by the deepCopy
function.
Parameters
Name | Type |
---|---|
object | unknown |
Returns
object is SerializedColor
Defined in
packages/isaacscript-common/src/functions/color.ts:111
serializeColor
▸ serializeColor(color
): SerializedColor
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
Name | Type |
---|---|
color | Color |