Closed markgandolfo closed 7 years ago
I’d like a bit deeper explanation of what a Packed RGB colour is for inclusion. At the same time, this feels like it should be an alternative constructor to the Color::RGB
, say Color::RGB.from_packed(integer)
(although I hate throwing away the alpha value in that process).
I'm happy to move it into the RGB class. A good explanation can be found: http://stackoverflow.com/questions/7358533/how-to-pack-argb-to-one-integer-uniquely
In regards to the alpha channel, maybe I misread the source, but it doesn't look like RGB handles alpha now, and hard sets it at 1? Perhaps we can create an RGBA class that extends the RGB class that handles alpha in some common scenarios, such as .html() which can return rgba(r,g,b,a)
Yeah. I didn’t want to suggest that for this PR, but it feels like we could have a meaningful RGBA class…or maybe we add alpha capabilities to RGB. I’m thinking of a color 2.0 release sometime this year, and this would be (probably) an acceptable (potentially) breaking change.
Add PackedRGB functionality.
i.e.