Coder Social home page Coder Social logo

color-books's Introduction

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.

color-books's People

Contributors

jacobbubu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.