1.0.3 • Published 10 months ago
@nvl/egal v1.0.3
[
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/tag/nvlang/egal?style=flat-square&logo=GitHub&logoColor=a3acb7&label=&labelColor=21262d&color=21262d&filter=@nvl/egal@*">
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/tag/nvlang/egal?style=flat-square&logo=GitHub&logoColor=24292f&label=&labelColor=eaeef2&color=eaeef2&filter=@nvl/egal@*">
<img alt="GitHub version tag" src="https://img.shields.io/github/v/tag/nvlang/egal?style=flat-square&logo=GitHub&logoColor=24292f&label=&labelColor=eaeef2&color=eaeef2&filter=@nvl/egal@*">Getting Started
Note: This package is ESM-only.
Installation
pnpm add @nvl/egal # If using PNPM
bun add @nvl/egal # If using Bun
npm add @nvl/egal # If using NPM
yarn add @nvl/egal # If using Yarn
deno add jsr:@nvl/egal # If using DenoUsage
For example:
import { egal } from '@nvl/egal';
const hues = [0, 60, 120, 180, 240, 300];
const lightnesses = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1];
const palette = hues.map((hue) =>
lightnesses.map((lightness) => egal(lightness, 1, hue, { hues }))
);
console.log(palette);