npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

misvarvi

v1.0.3

Published

A command-line tool to name colors using CIEDE2000, inspired by cherangi

Downloads

6

Readme

misvarvi

npm

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.

Installation

npm install --global misvarvi

Usage

Hex colors, CSS HSL, and CSS RGB are accepted, among a few other less useful forms. (See the chromatism docs for all valid forms.)

misvarvi '#AE3440'

It will return a JSON object, which you can then parse using something like jq.

{"delta":1.4980639388194081,"status":4,"hex":"#a73940","name":"Jules"}

The JSON object will always have the following values:

  • delta: the CIEDE2000 DeltaE between the input color and the returned match. null if no match was found.
  • status: see below
  • hex: the exact RGB hex color of the matched color
  • name: the name of the matched color

Status will be one of the following numbers:

  • -1: No match found.
  • 1: Exact match.
  • 2: Difference between match and input is not perceptible by humans.
  • 4: Difference between match and input is perceptible upon close observation.
  • 8: Difference between match and input is perceptible at a glance.
  • 16: Difference between match and input is very apparent, but they are more similar than different.
  • 32: Colors are different, but no better match was found.

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.