sass-color-calculator

0.1.4 • Public • Published

sass-color-calculator Build Status Dependency Status Coverage Status

calculate the Sass color functions required to get one color from a base color

Accepts almost all types of color strings, see color-delta for more info.

Partially extracted from Sass Colour Function Calculator.

Install

$ npm install --save sass-color-calculator

Usage

var sassColorCalculator = require('sass-color-calculator');
 
sassColorCalculator('#BADA55', '#B0BCA7');
// => "lighten(desaturate(adjust-hue(#BADA55, 19.8496), 50.7028), 10.1961)"

CLI

$ npm install --global sass-color-calculator
$ sass-color-calculator --help
 
  calculate the Sass color functions required to get one color from a base color
 
  Example
    sass-color-calculator BADA55 B0BCA7
    => lighten(desaturate(adjust-hue(BADA55, 19.8496), 50.7028), 10.1961)

API

Base

Type: String

Base color to calculate difference from.

Target

Type: String

Target color to calculate difference to.

Decimals

Type: String
optional

Fixed number of decimals in returned values.

Related

License

MIT © Matias Singers

Readme

Keywords

none

Package Sidebar

Install

npm i sass-color-calculator

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • matiassingers