Easy color computations using Sass/Stylus CLI

Stylus CLI

Use stylus's CLI for easy color computations. Stylus CLI is faster than Sass and has shorter syntax for color computations.

$ npm i -g stylus
$ stylus -i


Here's lighten and hue shift:

> #aaa + 10%
=> #b2b2b2

> #ff0 - 10deg
=> #ffd500

One-liner version

Not quite as elegant, but it can be useful.

echo "*{a: #ff0 - 10deg}" | stylus -p
* { a: #ffd500; }

Using Sass

If you need Sass for some reason, it also takes -i.

$ gem install sass
$ sass -i
>> darken(red, 10%)