KColor
Type Aliases
SerializedKColor
Ƭ SerializedKColor: LuaMap
<string
, unknown
> & { __serializedKColorBrand
: symbol
; __kind
: CopyableIsaacAPIClassType.K_COLOR
}
Defined in
packages/isaacscript-common/src/functions/kColor.ts:14
Functions
copyKColor
▸ copyKColor(kColor
): KColor
Helper function to copy a KColor
Isaac API class.
Parameters
Name | Type |
---|---|
kColor | KColor |
Returns
KColor
Defined in
packages/isaacscript-common/src/functions/kColor.ts:23
deserializeKColor
▸ deserializeKColor(kColor
): KColor
Helper function to convert a SerializedKColor
object to a normal KColor
object. (This is used
by the save data manager when reading data from the "save#.dat" file.)
Parameters
Name | Type |
---|---|
kColor | SerializedKColor |
Returns
KColor
Defined in
packages/isaacscript-common/src/functions/kColor.ts:37
getRandomKColor
▸ getRandomKColor(seedOrRNG
, alpha?
): Readonly
<KColor
>
Helper function to get a random KColor
object (for use in fonts).
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
<KColor
>
Defined in
packages/isaacscript-common/src/functions/kColor.ts:77
isKColor
▸ isKColor(object
): object is KColor
Helper function to check if something is an instantiated KColor
object.
Parameters
Name | Type |
---|---|
object | unknown |
Returns
object is KColor
Defined in
packages/isaacscript-common/src/functions/kColor.ts:91
isSerializedKColor
▸ isSerializedKColor(object
): object is SerializedKColor
Used to determine is the given table is a serialized KColor
object created by the deepCopy
function.
Parameters
Name | Type |
---|---|
object | unknown |
Returns
object is SerializedKColor
Defined in
packages/isaacscript-common/src/functions/kColor.ts:99
kColorEquals
▸ kColorEquals(kColor1
, kColor2
): boolean
Parameters
Name | Type |
---|---|
kColor1 | KColor |
kColor2 | KColor |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/kColor.ts:111
serializeKColor
▸ serializeKColor(kColor
): SerializedKColor
Helper function to convert a KColor
object to a SerializedKColor
object. (This is used by the
save data manager when writing data from the "save#.dat" file.)
Parameters
Name | Type |
---|---|
kColor | KColor |