KColor
Type Aliases
Section titled “Type Aliases”SerializedKColor
Section titled “SerializedKColor”SerializedKColor =
Readonly<LuaMap<string,unknown>> &object
Defined in: packages/isaacscript-common/src/functions/kColor.ts:14
Type Declaration
Section titled “Type Declaration”__serializedKColorBrand
Section titled “__serializedKColorBrand”
readonly__serializedKColorBrand:symbol
__kind
Section titled “__kind”
readonly__kind:CopyableIsaacAPIClassType.K_COLOR
Functions
Section titled “Functions”copyKColor()
Section titled “copyKColor()”copyKColor(
kColor):KColor
Defined in: packages/isaacscript-common/src/functions/kColor.ts:23
Helper function to copy a KColor Isaac API class.
Parameters
Section titled “Parameters”kColor
Section titled “kColor”KColor
Returns
Section titled “Returns”KColor
deserializeKColor()
Section titled “deserializeKColor()”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.)
Parameters
Section titled “Parameters”kColor
Section titled “kColor”Returns
Section titled “Returns”KColor
getRandomKColor()
Section titled “getRandomKColor()”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.
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<KColor>
isKColor()
Section titled “isKColor()”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.
Parameters
Section titled “Parameters”object
Section titled “object”unknown
Returns
Section titled “Returns”object is KColor
isSerializedKColor()
Section titled “isSerializedKColor()”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.
Parameters
Section titled “Parameters”object
Section titled “object”unknown
Returns
Section titled “Returns”object is SerializedKColor
kColorEquals()
Section titled “kColorEquals()”kColorEquals(
kColor1,kColor2):boolean
Defined in: packages/isaacscript-common/src/functions/kColor.ts:111
Parameters
Section titled “Parameters”kColor1
Section titled “kColor1”KColor
kColor2
Section titled “kColor2”KColor
Returns
Section titled “Returns”boolean
serializeKColor()
Section titled “serializeKColor()”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.)
Parameters
Section titled “Parameters”kColor
Section titled “kColor”KColor
