Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colors-generator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colors-generator - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc