color-namer-locale
v1.0.1
Published
Locale definitions for colorjs's color-namer
Maintainers
Readme
color-namer-locale
Locale (translation) packs for color names in Colorjs's color-namer.
Install
pnpm add color-namer-localeUsage
import { fa } from "color-namer-locale";
console.log(fa.basic.black); // "سیاه"
console.log(fa._meta.endonym); // "فارسی"Import a locale directly when you only need one:
import fa from "color-namer-locale/fa";Translate a color-namer result:
import colorNamer from "color-namer";
import { fa } from "color-namer-locale";
const english = colorNamer("#000000").basic[0]?.name;
const persian = english ? fa.basic[english as keyof typeof fa.basic] : undefined;Each locale includes _meta plus the color-namer lists: basic, html, x11, roygbiv, and pantone.
Locales
| Code | Language | Import |
| --- | --- | --- |
| fa | Farsi / Persian | color-namer-locale/fa |
Scripts
pnpm build: build todist/(ESM + CJS + types)pnpm test: build and run package testspnpm typecheck: TypeScript typecheck (no emit)
License
MIT
