Conversation
Adds Rgba8 type and some conversions and formatting. This PR also changes the serialization of srgb to use the color function. If legacy RGB serialization is desired, the client can convert to Rgba8 first. Closes #24.
|
I'm pushing this partly for discussion. There's not a huge amount of functionality attached to the new type - maybe that's a good thing, we should encourage all actual manipulation (including parsing) to happen in with the f32-based types. |
waywardmonkeys
left a comment
There was a problem hiding this comment.
I don't even see anything worth discussing offhand. Seems reasonable.
I guess the one thing might be if we wanted to have an Rgb8 without alpha, but I don't think that's necessary and if it was, experiment with it in the codebase that needs it.
The one thing that I see that might be missing is a to_premul_u32 method like peniko::Color has (and that Vello uses). But Vello can also just do that math on its own...
I believe that follows the spec, which does that unless the color was constructed directly from a named color or from a named color space (if I'm reading this correctly – note it excludes the e.g.,
In my experimental draft #39 I'm trying to find a nice implementation according to spec. |
|
Great, I'll merge this and then we can consider further refinements separately. |
Adds Rgba8 type and some conversions and formatting.
This PR also changes the serialization of srgb to use the color function. If legacy RGB serialization is desired, the client can convert to Rgba8 first.
Closes #24.