Coder Social home page Coder Social logo

uxfreak / nearest-pantone Goto Github PK

View Code? Open in Web Editor NEW
52.0 1.0 8.0 63 KB

JavaScript library to find the nearest Pantone color name for a given hex color. Uses CIEDE2000 color difference algorithm

License: MIT License

pantone pantone-colors ciede2000 color-namer

nearest-pantone's Introduction

nearest-pantone

JavaScript library to find the nearest Pantone color name for a given hex color. It uses CIEDE2000 color difference algorithm

Prerequisites

node

Installing

This module is also available as a NPM module, just install and start using in your project

You can view it at (NPM Link)[https://www.npmjs.com/package/nearest-pantone]

Install the NPM module using the following command

npm install nearest-pantone

And then require the module in your code by adding this:

const pant = require("nearest-pantone")

The input color needs to in HEX format eg. "#b37256"

Pass the input color as an argument in the following function

pant.getClosestColor(inputColor)

It'll return an object like this

{
	pantone : "16-1429", 
	name: "sunburn", 
	hex: "#b37256"
}

Here is a complete example to print the pantone name of the nearest color

const pant = require("nearest-pantone")

const inputColor = "#b37256"
const pantoneColor = pant.getClosestColor(inputColor)

console.log(pantoneColor.name)

// sunburn

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

nearest-pantone's People

Contributors

uxfreak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nearest-pantone's Issues

Remove get-color-name from npm registry

Hello there. I saw that you have this package twice on npm. One time as "get-color-name" and the other time as "nearest-pantone"
It would be very nice of you if you removed "get-color-name" from the registry as you already have the other package there in a newer version and I would like to use the name "get-color-name".

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.