import * as colors from "https://deno.land/x/colors@v2.0.0-rc.1/src/mod.ts";
Variables
6 / 29 | |
4 / 29 | |
Standard illuminant D65 |
Functions
Get average of colors. Can be used for grayscale. | |
Calculate chroma | |
f cmyk | Convert RGB(A) to CMYK |
Get contrast ratio | |
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. | |
f hcg | Convert RGB(A) to HCG |
f hex | Convert RGB(A) to Hex |
f hsl | Convert RGB(A) to Hue, Saturation, Lightness |
f hsv | Convert RGB(A) to Hue, Saturation, Value |
f hue | Calculate hue using chroma |
Inverse lab function | |
Invert a color linearly | |
Bright colors darken, dark colors brighten. | |
f json | |
f lab | CIE Lab color space |
f labF | t = C / Cn ratio |
Get lightness of color. | |
Get linear rgb values | |
Calculate luminance | |
f max | Get maximum of r, g, b |
Calculate mean distance between two colors | |
f min | Get minimum of r, g, b |
f mix | Mix with a different color. Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein http://sass-lang.com |
Get perceived lightness | |
Convert Hexadecimal string to RGBA | |
Convert CMYK to RGB | |
Convert HSL color to RGB | |
Convert HSV color to RGB | |
Convert CIE Lab to Linear RGB color space | |
Convert CIE XYZ to Linear RGB color space | |
Get saturation | |
Get a shade of the color | |
Stringify the RGBA color | |
f tint | Get a tint of the color |
f xyz | CIE 1931 XYZ |
Convert CIE Lab* to CIE XYZ |
Type Aliases
1-Channel Color (Grayscale) | |
3-Channel Color | |
4-Channel Color | |