color-by-chars

0.0.2 • Public • Published

color-by-chars

Generate color by characters. Mostly different characters, different colors. examples

Usage

npm

npm install color-by-chars
import colorByChars from 'color-by-chars'
// or const colorByChars = require('color-by-chars')
 
let [red, green, blue] = colorByChars('Hello World!')
 
// offset 100, make it different again.
let [red, green, blue] = colorByChars('Hello World!', 100)

browser

<script src='/path/to/color-by-chars.js'></script>
<script>
console.log(colorByChars('Hello World!'))
// => [34, 0, 0]
// [RED, GREEN, BLUE]
</script> 

How

Calculate the product by all charCode's of every character, then map it to color space.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i color-by-chars

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

8.1 kB

Total Files

7

Last publish

Collaborators

  • unclebill