Closed sunjay closed 6 years ago
I'm going to move into the remaining methods soon and get Color
complete
Awesome! Sounds great! Please send them just a few at a time (or even one at a time) so I can review them faster and get them through. :)
Thanks @stevepentland for your amazing work getting every single one of these implemented. Your work has made it so that all of these great features are available for the 1.0 release! :tada: :smile: :tada:
The Color struct could use some more methods to make different color operations possible. We can use the utilities provided by SASS for CSS colors as inspiration.
In particular, it would be nice to add the following methods to Color:
rgb
(static method that creates a color with alpha set to 1.0)rgba
(static method that creates a color)mix
hsl
(static method that creates a color)hsla
(static method that creates a color)hue
saturation
lightness
with_hue
rotate_hue
lighten
darken
saturate
desaturate
grayscale
complement
invert
Note that although these are functions in SASS, they should be added as methods on Color.
Not all of these functions need to be added at once. Feel free to only add a few of them at a time.
You can base the implementation on SASS or any other library with color functions. Please add some tests and a helpful documentation comment (with examples) to each added method. If you're not sure how this should look, see the documentation for the other color methods.