Installation
npm install --save @types/color-diff
Summary
This package contains type definitions for color-diff (https://github.com/markusn/color-diff#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-diff.
index.d.ts
export interface RGBColor {
R: number;
G: number;
B: number;
A?: number | undefined;
}
export interface LabColor {
L: number;
a: number;
b: number;
}
export function diff(c1: LabColor, c2: LabColor): number;
export function rgb_to_lab(c: RGBColor): LabColor;
export function rgba_to_lab(c: RGBColor, bc?: RGBColor): LabColor;
export function normalize_rgb(c: RGBColor): RGBColor;
export function closest(
color: RGBColor,
palette: readonly RGBColor[],
backgroundColor?: RGBColor,
): RGBColor;
export function furthest(
color: RGBColor,
palette: readonly RGBColor[],
backgroundColor?: RGBColor,
): RGBColor;
export function map_palette(
a: readonly RGBColor[],
b: readonly RGBColor[],
type?: "closest" | "furthest",
backgroundColor?: RGBColor,
): { [key: string]: RGBColor };
export function palette_map_key(c: RGBColor): string;
export function closest_lab(
color: LabColor,
palette: readonly LabColor[],
): LabColor;
export function furthest_lab(
color: LabColor,
palette: readonly LabColor[],
): LabColor;
export function map_palette_lab(
p1: readonly LabColor[],
p2: readonly LabColor[],
): { [key: string]: LabColor };
export function lab_palette_map_key(c: LabColor): string;
export function match_palette_lab(
target_color: LabColor,
palette: readonly LabColor[],
find_furthest: boolean,
): LabColor;
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: none
Credits
These definitions were written by katsanva.