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

x/colors/dist/color.js>Color

Color conversion and stuff in TypeScript
Go to Latest
class Color
import { Color } from "https://deno.land/x/colors@v1.2.0/dist/color.js";

Constructors

new
Color(
rOrHex,
g,
b,
a?,
)

Properties

a
readonly
average
b
readonly
chroma
readonly
cmyk
g
readonly
grayscale
readonly
hcg
readonly
hex
readonly
hsl
readonly
hsv
readonly
hue
readonly
invert
readonly
lab
readonly
lightness
readonly
linearRgb
readonly
luminance
readonly
max
readonly
min
readonly
perceivedLightness
r
readonly
saturation
readonly
xyz

Methods

contrast(that)
mix(that, percentage?)
shade(weight?)
tint(weight?)

Static Methods

fromCmyk(
c,
m,
y,
k,
)
fromHex(hex)
fromHsl(
h,
s,
l,
)
fromHsv(
h,
s,
v,
)
fromLab(
l,
a,
b,
)
fromRgba(
r,
g,
b,
a?,
)
fromXyz(
x,
y,
z,
)