UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

38 lines 1.95 kB
import type { CopyableIsaacAPIClassType } from "isaac-typescript-definitions"; export type SerializedKColor = LuaMap<string, unknown> & { readonly __serializedKColorBrand: symbol; readonly __kind: CopyableIsaacAPIClassType.K_COLOR; }; /** Helper function to copy a `KColor` Isaac API class. */ export declare function copyKColor(kColor: 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.) */ export declare function deserializeKColor(kColor: SerializedKColor): 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. * * @param seedOrRNG 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. * @param alpha Optional. The alpha value to use. Default is 1. */ export declare function getRandomKColor(seedOrRNG: Seed | RNG | undefined, alpha?: number): Readonly<KColor>; /** Helper function to check if something is an instantiated `KColor` object. */ export declare function isKColor(object: unknown): object is KColor; /** * Used to determine is the given table is a serialized `KColor` object created by the `deepCopy` * function. */ export declare function isSerializedKColor(object: unknown): object is SerializedKColor; export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean; /** * 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.) */ export declare function serializeKColor(kColor: KColor): SerializedKColor; //# sourceMappingURL=kColor.d.ts.map