JSPM

  • Created
  • Published
  • Downloads 12701943
  • Score
    100M100P100Q220480F
  • License MIT

👑 A tiny color manipulation and conversion tool

Package Exports

  • colord
  • colord/plugins/names

Readme

Colord is a tiny color manipulation and conversion tool

Features

  • 📦 Small: Just 1.5 KB gzipped (3+ times lighter than color and tinycolor)
  • 🚀 Fast: ~50% faster than color and tinycolor
  • 😍 Simple: Chainable API and familiar patterns
  • 💪 Immutable: No need to worry about data mutations
  • 🛡 Bulletproof: Written in strict TypeScript and 100% covered by tests
  • 🗂 Typed: All types are available out of the box
  • 🏗 Extendable: Built-in plugin system to add new functionality
  • 👫 Works everywhere: Supports all browsers and Node 12+
  • 💨 Zero-dependency

Benchmarks

Name ops/sec (millions) Size Size (gzip) Dependencies
colord 1 692 690
tinycolor2 998 946
color 736 610

Performance results were generated on a MBP 2019, 2,6 GHz Intel Core i7. To perform these tests, execute npm run benchmark in the library folder.

Roadmap

  • Parse and convert Hex, RGB(A), HSL(A), HSV(A)
  • Saturate, desaturate, grayscale
  • Trim an input value
  • Clamp input numbers to resolve edge cases (e.g. rgb(256, -1, 999, 2))
  • brightness, isDark, isLight
  • Set and get alpha
  • Plugin API
  • 4 and 8 digit Hex
  • lighten, darken
  • invert
  • CSS color names (via plugin)
  • A11y and contrast utils (via plugin)