A Sass function for the HWB color model
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
specs
src
.editorconfig
.gitignore
.travis.yml
Gruntfile.js
LICENSE
README.md
bower.json
package.json
sache.json

README.md

sass-hwb

A Sass function for the HWB color model Build Status

Introduction

The HWB color model is coming to CSS, and you can use it right now with Sass. Read more about the HWB model here and at the W3C working draft for the CSS color module, level 4.

Installation

Install it with bower or download the _hwb.scss file from this repository.

bower install --save sass-hwb

Include the _hwb.scss file in your main Sass file:

@import "/bower_components/sass-hwb/src/hwb";

And start using it:

body {
	// results in rgba(128, 255, 0, 0.5)
	background-color: hwb(90deg, 0, 0, 0.5);
	// results in #80e9ff
	color: hwb(190deg, 0.5, 0);
}

Enjoy!

Demo

Try it at Codepen

Credits

  • Kudos to @pangratz for introducing unit tests!