I am using egui for a project of mine, I currently have a variable which is
u32 which stores a hex value of a color.
I was wondering if there was a crate which using a macro or whatever it converts
u32 to three tuples of
u8 or arrays or whatever which can be used with egui's color picker?
You don't need a crate or a macro for this. It should be as easy as picking out 8 bits at a time from the
u32 (assuming it follows the normal convention of packing the raw RGB(A) bytes into a single wider integer). You can either use explicit bit operations for this purpose, or use
u32's built-in methods, such as
I've linked the relevant docs, you can click the link to find out.