tint-shade-color

1.0.0 • Public • Published

tint-shade-color

Build Status BrowserStack Status

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ć

/tint-shade-color/

    Package Sidebar

    Install

    npm i tint-shade-color

    Weekly Downloads

    617

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    31.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • niksy