Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
retraigo/colorsFunctional color conversion, shade/tint generation, and more in TypeScript.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
9 months ago (2.0.2)
A collection of functions to extract information from colors, generate shades and tints, convert to other color spaces, etc.
Note: All methods either accept RGB/RGBA colors as parameters or give RGB/RGBA colors as results. In order to work with other color spaces (eg. XYZ), convert them to RGB first.
Example 1
Example 1
// Deno /x import { rgbaFromHex, xyz, lab } from "https://deno.land/x/colors/mod.ts"; // Deno JSR import { rgbaFromHex, xyz, lab } from "jsr:@retraigo/colors"; // Node JSR (after installation) import { rgbaFromHex, xyz, lab } from "jsr:@retraigo/colors"; const color = rgbaFromHex("#fceff1"); // CIE XYZ color space console.log(xyz(color)); // CIE LAB color space console.log(lab(color)); // Conversion of color into all supported spaces console.log(json(color));
Built and signed on
GitHub Actions
Add Package
deno add jsr:@retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";
Import directly with a jsr specifier
import * as colors from "jsr:@retraigo/colors";
Add Package
pnpm i jsr:@retraigo/colors
pnpm dlx jsr add @retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";
Add Package
yarn add jsr:@retraigo/colors
yarn dlx jsr add @retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";
Add Package
vlt install jsr:@retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";
Add Package
npx jsr add @retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";
Add Package
bunx jsr add @retraigo/colors
Import symbol
import * as colors from "@retraigo/colors";