huetiful-js is a small (~10kB) & fast library for color manipulation written in JavaScript.
It is function oriented and borrows a lot of its features from color theory but tries to hide away the science from the developer.
The library aims to parse colors from as many types as possible allowing freedom to define our color tokens as we see fit as well as parse colors from other source. For instance, methods such as the HTML Canvas
API's getImageData()
method. The collection methods try to be as generic as possible by treating ArrayLike
and Map
-like objects as valid color collections so long as the values are parseable color tokens.
It uses Culori under the hood which provides access to low level functions for color conversions and other necessary bells and whistles that this library depends on. It works both in Node and the browser.
distance
against a comparison color and luminance
.saturation
or hue
in either descending or ascending order_.chain
utility allowing method chaining before returning our final output.Note that the library is ESM and UMD only.
Assuming you already have Node already installed, you can add the package using npm/yarn or any other Node based package manager:
npm i huetiful-js
Or:
yarn add huetiful-js
You can use also a CDN in this example, jsdelivr to load the library remotely:
import {...} from 'https://cdn.jsdelivr.net/npm/huetiful-js/lib/huetiful.esm.js'
Or load the library as a UMD glabal (huetiful
) in your HTML file using a <script>
tag:
# With script tag
<script src='https://cdn.jsdelivr.net/npm/huetiful-js/dist/huetiful.umd.js'></script>
See the discussions and just say hi, or share a coding meme (whatever breaks the ice🏔️)
This project is fully open source! Contributions of any kind are greatly appreciated! See🔍 the contributing page on the documentation site file for more information on how to get started.
This project is a result of open source resources from many places all over the Internet.
See some of the references here
License ⚖️ © 2024, Dean Tarisai & xml-wizard contributors Released under the Apache 2.0 license. 🧪 & 🔬 with 🥃 in Crowhill,ZW