1.2.5 • Published 6 months ago

@types/color-diff v1.2.5

Weekly downloads
734
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for color-diff 1.2
// Project: https://github.com/markusn/color-diff#readme
// Definitions by: katsanva <https://github.com/katsanva>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: ReadonlyArray<RGBColor>,
  backgroundColor?: RGBColor
): RGBColor;

export function furthest(
  color: RGBColor,
  palette: ReadonlyArray<RGBColor>,
  backgroundColor?: RGBColor
): RGBColor;

export function map_palette(
  a: ReadonlyArray<RGBColor>,
  b: ReadonlyArray<RGBColor>,
  type?: "closest" | "furthest",
  backgroundColor?: RGBColor
): { [key: string]: RGBColor };

export function palette_map_key(c: RGBColor): string;

export function closest_lab(
  color: LabColor,
  palette: ReadonlyArray<LabColor>
): LabColor;

export function furthest_lab(
  color: LabColor,
  palette: ReadonlyArray<LabColor>
): LabColor;

export function map_palette_lab(
  p1: ReadonlyArray<LabColor>,
  p2: ReadonlyArray<LabColor>
): { [key: string]: LabColor };

export function lab_palette_map_key(c: LabColor): string;

export function match_palette_lab(
  target_color: LabColor,
  palette: ReadonlyArray<LabColor>,
  find_furthest: boolean
): LabColor;

Additional Details

  • Last updated: Thu, 08 Jul 2021 09:08:02 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by katsanva.

1.2.5

6 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

9 months ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

5 years ago