You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That would probably be a nice addition, but the implementation would have to be clear about what the channel order is. 🤔 Some put the alpha in one end, and some in the other. Some reverse the red, green and blue, and so on. The assumed channel order in Palette is currently RGBA and there is not yet any built-in way of encoding them in any other order, so being able to do it would be a new addition.
Your example function is about as good as it gets with the current API. It's possible to make changes like replacing from_format with .into_format() and such, but it's still the same procedure in the end. 🙂
It's common to store sRGB values packed in a
u32
(eg. 0xAARRGGBB) - it would be helpful to provide functions to convert to this format.I need to convert from linear, floating-point RGB to a packed sRGB u32, and the way I'm currently doing it is like this:
I'm not sure if this is the best way to do it.
The text was updated successfully, but these errors were encountered: