stevenpetryk/rustle — pull request #2 by jhamon (2014-05-07 22:28:05+00:00)
Title: Refactor Rustle::Color to improve readability, validate hsb arguments.

Not sure if you're still working on this project. I was reviewing the changes I made a few months ago in my last PR and found more places to tighten up the syntax, especially as regards the giant `case`/`when`.

Perhaps controversial, I also added explicit argument checking to the `Rustle::Color.hsb` factory. I think in this case, unlike the `rgb` factory, it's better to give an error because many sources list saturation and brightness values as percents in the range 0-100. If you, for instance, were to call `Rustle::Color.hsb(120, 50, 50)` the old version would silently convert these to `(120, 1, 1)` when the desired is `(120, 0.5, 0.5)`, a completely different color.