@effective/color
Version:
Color Palette Generator based on Human Perception
24 lines (23 loc) • 1.39 kB
TypeScript
import { Color, Gamut, Oklab } from "culori";
export interface ShadeConfig {
colorSteps: number;
colorDifference: number;
darkColorCompensation: number;
mixerSteps: number;
outputSpace: Color["mode"];
outputGamut: Gamut["mode"];
outputCSS: boolean;
outputPrecision: number;
}
export declare function findNextShade(start: ColorValue, end: string, config: ShadeConfig): Oklab | undefined;
export declare function convertToOutputFormat(color: Color | undefined, config?: Partial<ShadeConfig>): string | import("culori/src/common").FindColorByMode<"a98" | "cubehelix" | "dlab" | "dlch" | "hsi" | "hsl" | "hsv" | "hwb" | "jab" | "jch" | "lab" | "lab65" | "lch" | "lch65" | "lchuv" | "lrgb" | "luv" | "okhsl" | "okhsv" | "oklab" | "oklch" | "p3" | "prophoto" | "rec2020" | "rgb" | "xyz50" | "xyz65" | "yiq">;
export type ColorValue = string | Color | undefined;
export declare function buildShades(start: ColorValue, end: string, config?: Partial<ShadeConfig>): Array<string | Color>;
export type ColorSpectrum = Record<string, string | Color>;
export declare function buildSpectrum(start: ColorValue, config?: Partial<ShadeConfig>): ColorSpectrum;
export type SpectrumEntry = {
id: string;
value: string | Color | undefined;
};
export type SpectrumList = SpectrumEntry[];
export declare function spectrumToList(spectrum: ColorSpectrum): SpectrumList;