https://github.com/nblthree/colortone
Color toner
https://github.com/nblthree/colortone
color color-tone colors javascript
Last synced: about 1 year ago
JSON representation
Color toner
- Host: GitHub
- URL: https://github.com/nblthree/colortone
- Owner: nblthree
- License: mit
- Created: 2020-03-01T15:50:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T10:21:46.000Z (over 5 years ago)
- Last Synced: 2025-03-18T04:51:30.067Z (over 1 year ago)
- Topics: color, color-tone, colors, javascript
- Language: JavaScript
- Homepage: https://colortone.now.sh/
- Size: 1.89 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Colortone
## Getting Started
```
npm install @marchworks/colortone
```
Or if you are using yarn
```
yarn add @marchworks/colortone
```
### Usage
```
import colortone from 'colortone';
// colortone(color, ratio) --> hex || null
const darkerBlueTone = colortone("#0000ff", -0.05)
const lighterBlueTone = colortone("#0000ff", 0.05)
```
### Args
The color arg can be in any of the following formats
```
"#rrggbb"
"#rgb"
[r, g, b] --> the r, g and b values should be of type number
{r, g, b} --> the r, g and b values should be of type number
```
the ratio can not be outside [-1, 1]