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

colorally

v2.0.8

Published

Name colors by well-known definitions

Downloads

40

Readme

🎨 colorally - Name colors by well-known definitions.

NPM build codecov dependabot semantic-release license

Provide a color and colorally will measure the color difference against a set of well-known definitions and return the name of the closest match. Available as a command-line application, CommonJS and ES module.

Why

  • Consistent color names between projects.
  • End the use of non descriptive color names, ie. color-faded-gray.
  • Measures difference by delta-e (difference perceived by the human eye).
  • Over 950 different color definitions.
  • Allows input and output in multiple formats.

Install

Using npm:

# Install locally.
$ npm install colorally

# Install globally.
$ npm install --global colorally

Using yarn:

# Install locally.
$ yarn add colorally

# Install globally.
$ yarn global add colorally

Build from source:

$ git clone [email protected]:sQVe/colorally.git
$ cd colorally/
$ npm install && npm run build

Command-line application

You can either install the application, see above, or run it temporarily with npx colorally.

colorally - Name colors by well-known definitions

USAGE

  colorally [option...] [hex]
  colorally [option...] [red] [green] [blue]

  The hex argument can contain either 3 or 6 digits with an optional leading
  0x or #.

  The red, green and blue arguments may only contain digits.

OPTIONS

  -V, --version            output version number
  -c, --copy               copy definition to clipboard
  -f, --format case        output definition in specified format
  -h, --help               output usage information
  -v, --verbose            provide a more talkative result

  The case argument can be either camel fooBar, constant FOO_BAR, dot foo.bar,
  kebab foo-bar, lower foo bar, pascal  FooBar, snake foo_bar title Foo Bar or
  upper FOO BAR. By default, colorally sets case as title.

API

colorally is available as a CommonJS and ES module.

import colorally from 'colorally'

// Onyx.
colorally(0x111111)
colorally(119227)

// Light Gray.
colorally('ccc')
colorally('0xccc')
colorally('#cccc')
colorally('cccccc')
colorally('0xcccccc')
colorally('#ccccccc')

// Fuzzy Wuzzy.
colorally([200, 100, 100])

colorally(value)

Parameters
  • value (number, string or [number, number, number]) - A color value
Returns

The closest matching definition object together with its measured distance:

{
  distance: number,
  name: string,
  rgb: [number, number, number]
}

Contributing

Bug reports & feature requests

Please use the issue tracker to report bugs or make feature requests.

Developing

Pull requests are more than welcome. The following will get you started:

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Run npm install in the created directory to install all necessary dependencies.
Style guide & conventions

Follow functional programming best practices - use pure functions and composition when possible. Write commit messages with Angular Commit Message Conventions. This enables semantic-release to do all kinds of automatic goodies (release, changelong and more). Linting and formatting is heavily enforced on both pre-commit and on push to Travis.

Shout-out

Color definition sources:

License

MIT License