JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 114786
  • Score
    100M100P100Q151084F
  • License MIT

Package Exports

  • color-hash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-hash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Color Hash

Generate color based on the given string.

Demo

https://zenozeng.github.io/color-hash/demo/

Usage

Browser

bower install color-hash

A UMD version of ColorHash was located in dist/.

Note that Array.prototype.map was used in color-hash, a pollfill must be provided if you want to use it in IE8.

Node.JS

npm install color-hash --save
var ColorHash = require('color-hash');

License

MIT.

FAQ

Why not LAB?

虽然 LAB 的色彩分布对人眼要更加线性一些,但是色域要更大,转换过程要更加复杂。 考虑的一个关键点在于,HSL 色彩空间可以很方便地控制参数, 比如亮度和饱和度,这样生成出来的颜色都是一个比较均匀和谐的分布。

Dev

Test

sudo npm install -g mocha
npm test

Coverage Report

https://zenozeng.github.io/color-hash/test/coverage.html

Build browser js

sudo npm install -g browserify
npm run build

Follow Semantic Versioning

http://semver.org/lang/zh-CN/