string-hash-colour

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i string-hash-colour

Weekly Downloads

8

Version

0.0.2

License

GPLv3

Last publish

Collaborators

  • gausie