❀

colord
TypeScript icon, indicating that this package has built-in type declarations

0.5.3Β β€’Β PublicΒ β€’Β Published
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

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

Package Sidebar

Install

npm i colord@0.5.3

Version

0.5.3

License

MIT

Unpacked Size

19.2 kB

Total Files

12

Last publish

Collaborators

  • omgovich