Color-Description is a class that turns a technical color representation into a human readable description.
npm install color-description
import ColorDescription from "color-description/dist/index.esm";
console.log(ColorDescription);
const cd = new ColorDescription("#ffffff");
console.log(cd.getDescriptiveList());
/**
* pale, light, faded, delicate, glistening, bleached, neutral colorless, bright, briliant and high
**/
cd.color = "red";
console.log(cd.getDescriptiveList());
/**
* saturated, strong, lush, ablaze, beaming, bold, brilliant, flamboyant, vibrant, vivid, loud, very saturated, warm, mellow, red and reddish
**/The default dataset that is written in english so the "Emotions" and "Usage" very subjective and are written from a western perspective: https://github.com/words/color-description/blob/21ffa6b522f1751b471907aac4173acdc5c92fae/src/en.js
const cd = new ColorDescription(color);color(string | object): A color representation (hex, rgb, hsl, or similar)
getDescriptiveList(): Returns an array of descriptive words for the colorgetColorFamily(): Returns the color family/category (e.g., "red", "blue")
color: Get or set the current color
This package supports multiple module formats:
- ESM (modern):
dist/index.esm.js - CommonJS (Node.js):
dist/index.js - IIFE (browser):
dist/index.iife.js
# Build all formats
npm run build
# Run tests
npm run test
# Development with watch mode
npm run devMIT