Socket
Socket
Sign inDemoInstall

color-hash

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    color-hash

Generate color based on the given string.


Version published
Weekly downloads
82K
decreased by-0.9%
Maintainers
1
Install size
44.9 kB
Created
Weekly downloads
 

Readme

Source

Color Hash

Generate color based on the given string.

Status

Still coding.

License

MIT.

Demo

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

Usage

Browser

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');

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/

FAQs

Last updated on 09 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc