https://github.com/nmsn/color-utils
A color transform utils collection.
https://github.com/nmsn/color-utils
color color-picker hex hsl hsla rgb rgba
Last synced: 8 days ago
JSON representation
A color transform utils collection.
- Host: GitHub
- URL: https://github.com/nmsn/color-utils
- Owner: nmsn
- License: mit
- Created: 2022-07-12T09:40:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T03:23:27.000Z (over 1 year ago)
- Last Synced: 2025-01-01T22:16:26.530Z (10 months ago)
- Topics: color, color-picker, hex, hsl, hsla, rgb, rgba
- Language: TypeScript
- Homepage:
- Size: 219 KB
- Stars: 20
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# color-utils




[](https://codecov.io/gh/nmsn/color-utils)
English | [简体中文](./README.zh-CN.md)
Color conversion tool library.
## Features
- `RGB`/`RGBA`/`HEX`/`HSL`/`HSLA`/`color-name` color interconversion. ([color-name]
- Validators for the above types of colors.
- Provide computational multi-color fusion function.
- Provides the function of calculating the complementary color.
- Provide the function of judging the color light and dark (mostly used to deal with the relationship between the background color and the displayed text).## Install
```
npm install @nmsn/color-utils
```## Usage
```js
import { isLight } from '@nmsn/color-utils';const isLightColor = isLight('#999'); // true
```Online Address: [https://color-utils-site.vercel.app/](https://color-utils-site.vercel.app/)
Project Address: [https://github.com/nmsn/color-utils-site](https://github.com/nmsn/color-utils-site)
## Finished
- [x] `RGB`/`RGBA`/`HEX`/`HSL`/`HSLA`/`color-name` interconversion.
- [x] Checksum functions for each color format.
- [x] Unit testing of existing features.
- [x] Color fusion calculations.
- [x] Complementary color calculation.
- [x] Color brightness judgment.
- [x] `Rollup` Basic Function Package.## Todo
- [ ] `Rollup` packed volume optimization.
- [ ] Code optimization.## Contributing
- [nmsn](https://github.com/nmsn)
## License
[MIT License](https://github.com/nmsn/color-utils/blob/main/LICENSE)