Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/colors/src/common.ts

Color conversion and stuff in TypeScript
Go to Latest
import * as colors from "https://deno.land/x/colors@v2.0.1/src/common.ts";

Variables

6 / 29

4 / 29

Standard illuminant D65

Functions

Find the nearest neighbour of a color in a palette It would be more accurate to use consider luminance along with Euclidean distance but I chose to stay with distance for performance.

Inverse lab function

t = C / Cn ratio

Calculate mean distance between two colors

Type Aliases

1-Channel Color (Grayscale)

3-Channel Color

4-Channel Color