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

color-books

v0.1.2

Published

Easily use color books in Javascript.

Downloads

28

Readme

Introduction

The purpose of this module is to provide a way to easily use color books in Javascript.

Install

npm i color-books

Usage

Please see example.js as an usage example:

const { booknames, load } = require('color-books');

let totalCount = 0
for (const name of booknames) {
  const book = load(name);
  totalCount += book.colorCount;
  console.log(`${name}: ${book.colorCount} colors`);
}
console.log(`===\nTotal color count: ${totalCount}`);
console.log("===");
const { title, colorSpace, records, isSpot, colorCount } = load('PANTONE+ Solid Coated');
console.log(title, `\n\tColor space: ${colorSpace}`);
console.log(`\tIs spot color?: ${isSpot}`);
console.log(`\t'PANTONE Orange 021 C':`, records['PANTONE Orange 021 C'].components)

The output would be:

ANPA Color: 300 colors
DIC Color Guide: 1280 colors
FOCOLTONE: 763 colors
...
PANTONE+ CMYK Coated: 2868 colors
PANTONE+ Metallic Coated: 301 colors
...
TRUMATCH: 2091 colors
===
Total color count: 19198
===
PANTONE+® Solid Coated
    Color space: LAB
    Is spot color?: true
    'PANTONE Orange 021 C': [ 60.7843137254902, 66, 85 ]

Details

It contains 19,198 color records in 23 books as following:

  • ANPA Color: 300
  • DIC Color Guide: 1280
  • FOCOLTONE: 763
  • HKS E: 88"code": "1-2",
  • HKS K Process: 86
  • HKS K: 88
  • HKS N Process: 86
  • HKS N: 86
  • HKS Z Process: 86
  • HKS Z: 50
  • PANTONE+ CMYK Coated: 2868
  • PANTONE+ CMYK Uncoated: 2868
  • PANTONE+ Color Bridge Coated: 1313
  • PANTONE+ Color Bridge Uncoated: 1313
  • PANTONE+ Metallic Coated: 301
  • PANTONE+ Pastels & Neons Coated: 210
  • PANTONE+ Pastels & Neons Uncoated: 210
  • PANTONE+ Premium Metallics Coated: 300
  • PANTONE+ Solid Coated: 1341
  • PANTONE+ Solid Uncoated: 1341
  • TOYO 94 COLOR FINDER: 1050
  • TOYO COLOR FINDER: 1079
  • TRUMATCH: 2091

The meta-data in each book includes:

  • version: the book version
  • title: e.g. "PANTONE+® CMYK Coated"
  • prefix": e.g. "PANTONE P "
  • suffix": e.g. " C"
  • colorCount": 2868
  • colorSpace": "CMYK"
  • channels": 4
  • isSpot: true / false
  • record: color records dictionary

The color recod consists of 3 fields:

  • name: e.g. "PANTONE P Process Cyan C"
  • code: e.g. "PCYANS",
  • components: e.g. [100, 0, 0, 0] -- CMYK has 4 numbers; RGB and LAB has just 3 numbers.