Skip to content

KColor

SerializedKColor = Readonly<LuaMap<string, unknown>> & object

Defined in: packages/isaacscript-common/src/functions/kColor.ts:14

readonly __serializedKColorBrand: symbol

readonly __kind: CopyableIsaacAPIClassType.K_COLOR

copyKColor(kColor): KColor

Defined in: packages/isaacscript-common/src/functions/kColor.ts:23

Helper function to copy a KColor Isaac API class.

KColor

KColor


deserializeKColor(kColor): KColor

Defined in: packages/isaacscript-common/src/functions/kColor.ts:37

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.)

SerializedKColor

KColor


getRandomKColor(seedOrRNG, alpha?): Readonly<KColor>

Defined in: packages/isaacscript-common/src/functions/kColor.ts:77

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.

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.

number = 1

Optional. The alpha value to use. Default is 1.

Readonly<KColor>


isKColor(object): object is KColor

Defined in: packages/isaacscript-common/src/functions/kColor.ts:91

Helper function to check if something is an instantiated KColor object.

unknown

object is KColor


isSerializedKColor(object): object is SerializedKColor

Defined in: packages/isaacscript-common/src/functions/kColor.ts:99

Used to determine is the given table is a serialized KColor object created by the deepCopy function.

unknown

object is SerializedKColor


kColorEquals(kColor1, kColor2): boolean

Defined in: packages/isaacscript-common/src/functions/kColor.ts:111

KColor

KColor

boolean


serializeKColor(kColor): SerializedKColor

Defined in: packages/isaacscript-common/src/functions/kColor.ts:119

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.)

KColor

SerializedKColor