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

pantone-backbone

v0.0.8

Published

Find the nearest PMS color using hex or rgb colors from CLI or as a dependency.

Downloads

3

Readme

PMS Pantone® Color Chart Version Badge

Find the nearest PMS color using hex or rgb colors from command line or as a dependency.

No need to use Adobe Photoshop® eye dropper tool nor swatch libraries!

PMS Pantone Color Chart RGB CMYK Hex Matching

Interested in buying a physical Pantone® color formula guide? Pantone GP1301XR Formula Guide Solid Coated and Solid Uncoated

Install

npm install -g pantone

CLI

Let's try to find the nearest PMS color to Teelaunch's blue in hex:

Teelaunch Logo

pantone --hex 2A70AE

Or we could use the rgb values:

pantone --rgb 42,112,174

Output in table format on command line:

┌───────┬─────────────────┬────┬─────┬─────┬────────┐
│ dist  │ name            │ r  │ g   │ b   │ hex    │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0     │ Your query      │ 42 │ 112 │ 174 │ 2A70AE │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.023 │ 660             │ 66 │ 107 │ 186 │ 426BBA │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.037 │ 2728            │ 51 │ 66  │ 181 │ 3342B5 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.042 │ 285             │ 26 │ 117 │ 207 │ 1A75CF │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.046 │ 7455            │ 77 │ 89  │ 171 │ 4D59AB │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.05  │ 653             │ 54 │ 87  │ 140 │ 36578C │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.053 │ 7459            │ 71 │ 153 │ 181 │ 4799B5 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.055 │ 641             │ 0  │ 120 │ 173 │ 0078AD │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.056 │ 307             │ 0  │ 120 │ 171 │ 0078AB │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.057 │ 647             │ 38 │ 87  │ 135 │ 265787 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.058 │ 7462            │ 13 │ 92  │ 145 │ 0D5C91 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.064 │ Process Blue 2X │ 0  │ 119 │ 191 │ 0077BF │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.064 │ 801 2X          │ 0  │ 137 │ 175 │ 0089AF │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.064 │ 3015            │ 0  │ 102 │ 158 │ 00669E │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.065 │ 7468            │ 0  │ 121 │ 156 │ 00789C │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.066 │ 314             │ 0  │ 133 │ 161 │ 0085A1 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.066 │ 633             │ 0  │ 128 │ 158 │ 00809E │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.066 │ 2945            │ 0  │ 87  │ 166 │ 0057A6 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.07  │ 7473            │ 54 │ 163 │ 145 │ 36A391 │
├───────┼─────────────────┼────┼─────┼─────┼────────┤
│ 0.071 │ 640             │ 0  │ 140 │ 186 │ 008CBA │
└───────┴─────────────────┴────┴─────┴─────┴────────┘

Dependency

1. Install npm module:

cd ~/project
npm install pantone

2. Require and lookup color:


var pantone = require('pantone')

// rgb usage

pantone({ r: 42, g: 112, b: 174 }, rgbCallback)

function rgbCallback(err, results) {
  if (err) throw new Error(err)
  console.log(results)
}

// hex usage

pantone({ hex: '#2A70AE' }, hexCallback) // you can also use `rgb` instead of `hex`

function hexCallback(err, results) {
  if (err) throw new Error(err)
  console.log(results)
}

Proxy settings

For all of you who are behind a proxy server we are using the process.env property from node to take the value from HTTP_PROXY or HTTPS_PROXY in order to make the call to the server. This means that you need to set those properties as environment variables (it's a good thing anyways because lots of other apps are using this property).

Windows

  1. Right-click My Computer, and then click Properties.
  2. Click the Advanced tab \ Advanced system settings.
  3. Click Environment variables.
  4. Under System variables Click New to add a new variable name and value.
  5. Variable name: http_proxy
  6. Variable value: http://proxy-server.mycorp.com:8080 (replace the value with your details, the general syntax is: http://username:password@proxyhost:port/ )
  7. Click OK and save your changes

Now if everything went down OK you should be able to use Pantone.

Ubuntu (various Linux distributions)

Notice: I tested this on a VM locally and worked perfectly but might not work for you depending on various factors, so if you have more knowledge please submit a pull request, or let us know and we can update this readme file.

If you want to use a proxy server only once in one terminal window use this command:

export http_proxy=http://proxy-server.mycorp.com:8080

If you want a more permanent solution:

Put the environment variable into the global /etc/environment file:

http_proxy=http://proxy-server.mycorp.com:8080

Execute source /etc/environment in every shell where you want the variables to be updated:

$ source /etc/environment

Check that it works:

$ echo $http_proxy
$ http://proxy-server.mycorp.com:8080

More info here: https://help.ubuntu.com/community/EnvironmentVariables

Notice

PANTONE® and other Pantone, Inc. trademarks are the property of Pantone, Inc.

Amazon Associate Network