Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kricsleo/go-color
color utils
https://github.com/kricsleo/go-color
Last synced: 24 days ago
JSON representation
color utils
- Host: GitHub
- URL: https://github.com/kricsleo/go-color
- Owner: kricsleo
- Created: 2021-08-03T04:20:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T04:25:51.000Z (over 3 years ago)
- Last Synced: 2024-09-26T20:37:51.216Z (about 1 month ago)
- Language: TypeScript
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-color
**hex**, **rgb**和**hsv**颜色转换函数, 在做颜色变换生成衍生色的时候可以使用
## usage
```js
import { hex2rgb, rgb2hsv, hsv2rgb, rgb2hex } from '@kricsleo/go-color';const color = '#eee';
const rgb = hex2rgb(color);
const hsv = rgb2hsv(rgb);
const newHsv = [hsv[0], hsv[1] + 20, hsv[2] - 10];
const newRgb = hsv2rgb(newHsv);
const newColor = rgb2hex(newRgb);
```