tint-shade-color
Tint or shade color.
Similar to Bourbon tint and shade functions (see test case).
Install
npm install tint-shade-color --save
Usage
import { tint, shade } from 'tint-shade-color';
tint('#6ecaa6', 0.4); // #a8dfca
shade('#ffbb52', 0.6); // #664b21
API
tint|shade(color, [percentage])
Returns: string
Mixes a color with white (if tint) or black (if shade).
color
Type: string
Color to mix with white (if tint) or black (if shade). It should be a valid hex color.
percentage
Type: number
Default: 1
The amount of white (if tint) or black (if shade) to be mixed in.
Acknowledgments
Original function taken from
Sass mix()
function gist.
Browser support
Tested in IE9+ and all modern browsers.
Test
For automated tests, run npm run test:automated
(append :watch
for watcher
support).
License
MIT © Ivan Nikolić