Skip to content

A simple js tool to give back the color-name of a hex value

Notifications You must be signed in to change notification settings

MathuraMG/color-namer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colornamer

A simple npm module/js client library that gives back the color-name of a hex or rgb value.

Created to provide accessible color names to people who are blind and visually impaired as part of the p5 accessible canvas project (https://github.com/processing/p5.accessibility) for the p5.js web editor (https://github.com/processing/p5.js-web-editor).

NPM module

For use with Node.js: npm install colornamer

var color = require('colornamer');

color.rgbColorName(255,0,0); //returns red
color.hexColorName('ff0000'); //returns red

Client library

Link to the library in your html: https://rawgit.com/lm-n/color-namer/master/lib/colorNamer.js
Use the following functions to get a color name:
rgbColorName(255,0,0); //returns red the expected input is three ints
hexColorName('ff0000'); //returns red the expected input is a string of six characters without "#" at the beginning

About

A simple js tool to give back the color-name of a hex value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published