Closed kornelski closed 1 month ago
I think the simplest fix would be to make make an impl
for each integer size rather than generically for all component types.
We might have to pull in a dependency on const_format
to make the macros easier though.
I'm thinking about fudging it: lower hex assumes 2 digits, and upper hex puts spaces or commas between the numbers (as in: use big X
for big numbers).
Alternatively, we could just abandon the 2-digit padding entirely, that way it's simple to implement. The main use-case I can think of is CSS-compatable hex color format but that seems best implemented by a user via a custom trait anyway as discussed in #1 and #52.
Oh, size_of<T>() == 1
could be used to select the CSS hex format!
:02x
assumes max 0xFF, butRgba<u16>
can need 4 digits.