UNPKG

@thi.ng/color

Version:

Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets

29 lines 857 B
import type { IRandom } from "@thi.ng/random"; import type { TypedColor } from "./api.js"; export interface VariationOpts { /** * Max. number of color variations to produce. * * @defaultValue Infinity */ num: number; /** * Weights (given in same order as colors) for randomly selecting colors. By * default colors will be chosen with uniform distribution. */ weights: number[]; /** * Normalized tolerance value for randomizing channel values * * @defaultValue 0.05 */ delta: number; /** * PRNG instance to use. * * @defaultValue SYSTEM (aka `Math.random()`) */ rnd: IRandom; } export declare function variations<T extends TypedColor<any>>(src: T[], opts?: Partial<VariationOpts>): Generator<T, void, unknown>; //# sourceMappingURL=variations.d.ts.map