Skip to content

NPM module to pick a colour from a string. Repeatable but not reversable.

Notifications You must be signed in to change notification settings

gausie/string-hash-colour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

string-hash-colour

Pick a colour from a string. Repeatable but not reversable.

You can also choose a colour you would like to avoid similarity to, with a given minimum proximity.

Example

var shc = require("string-hash-colour");

shc.convert("Hello world!")	// #1b8519

shc.convert("Hello world!", { avoid: "#1b8519" }); //#b85199

shc.convert("Hello world!", { avoid: "#1b8519", proximity: 100 }); // ...still #b85199. I can't find a hash that isn't very far away immediately upon detection of proximity. But this is how you use it, anyway.

Install

Use node with npm:

npm install string-hash-colour

About

NPM module to pick a colour from a string. Repeatable but not reversable.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published