This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
misvarvi with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
misvarvi, Estonian for "What color?", is a command-line tool that finds the closest color in color-name-list to the color that was passed in, using the CIEDE2000 color difference algorithm. It was inspired by cherangi but was designed for command-line use, so it emits a well-formed JSON object instead of a debug object, and was also switched to use the CIEDE2000 algorithm instead of the CIE94 algorithm, as it's more accurate.
npm install --global misvarvi
Hex colors, CSS HSL, and CSS RGB are accepted, among a few other less useful forms. (See the chromatism docs for all valid forms.)
It will return a JSON object, which you can then parse using something like jq.
The JSON object will always have the following values:
nullif no match was found.
Status will be one of the following numbers:
They are bitflags because cherangi used bitflags, not because they will ever be returned OR'd together. They could've easily been 0, 1, 2, 3, 4, 5, and 6, but I already have scripts designed for cherangi and didn't want to change them.