colors-generator
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "colors-generator", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/colors-generator.js", |
@@ -1,4 +0,4 @@ | ||
# 颜色生成 | ||
# colors-generator | ||
在基础色的基础上,,通过H值多层均分,生成同一亮度和纯度的多个颜色,应用场景如图表的图例展示 | ||
generate colors in same lightness and purity from a base color | ||
@@ -8,16 +8,32 @@ ## api | ||
``` | ||
// 根据基础色生成色系 | ||
generate(color, num).get() | ||
generate('#86bff2', 10).get() => ["#86bff2", "#8e86f2", "#cf86f2", "#f286d5", "#f28694", "#f2b986", "#eaf286", "#a9f286", "#86f2a3", "#86f2e4"] | ||
``` | ||
// 提高亮度 | ||
generate(color, num).lighter(0.2).get() | ||
![](https://img.alicdn.com/tfs/TB1FEnmQFXXXXcjXVXXXXXXXXXX-1379-145.png) | ||
// 减少亮度 | ||
``` | ||
generate('#86bff2', 10).lighter(0.1).get() | ||
``` | ||
![](https://img.alicdn.com/tfs/TB1DOLFQFXXXXceXpXXXXXXXXXX-1382-132.png) | ||
``` | ||
generate(color, num).darker(0.2).get() | ||
``` | ||
// 提高纯度 | ||
generate(color, num).purer(0.2).get() | ||
![](https://img.alicdn.com/tfs/TB1uo2VQFXXXXXiXXXXXXXXXXXX-1376-117.png) | ||
// 减少纯度 | ||
generate(color, num).impurer(0.2).get() | ||
``` | ||
generate(color, num).purer(0.1).get() | ||
``` | ||
![](https://img.alicdn.com/tfs/TB1xbPmQFXXXXceXVXXXXXXXXXX-1390-134.png) | ||
``` | ||
generate(color, num).impurer(0.1).get() | ||
``` | ||
![](https://img.alicdn.com/tfs/TB1FEnmQFXXXXcjXVXXXXXXXXXX-1379-145.png) | ||
lightness and purity are both between [0, 1] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9558
39