Yet another minimal color library for javascript
Because we can... and it's fun to learn doing something reusable.
For now, this repo only has code thrown into an editor. It needs to be polished, and also refactored.
If regarding all the warnings about this experimental project you want to use it as is right now, you can use it as follows:
var red = color("#ff0000");
var lightRed = red.lighten(0.2); // 20% lighter red
var darkRed = red.darken(0.7); // 70% darker red
var lightestRed = red.lighten(1); // 100% lighter red (i.e. white)
var complementary = red.complementary(); // complementary (i.e. turquoise)
Pretty simple. But what if you want to apply those calculations for some useful end?
document.body.backgroundColor = darkRed.css();
Done. Background color is 70% dark red now. And Vanilla JS™ was all we needed.
- Sort code
- Review DSL. Expect changes, then!
- Fork it ( https://github.com/wecodeio/colors/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request