Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/colors/src/common.ts

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

Variables

6 / 29

4 / 29

(6 / 29)^3

(6 / 29)^2

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