Closed bagomot closed 1 year ago
I'm not the author of this code, but I assume it has something to do with endianess (it always is). If you want, you can add decodeHexColorRGBA
and I will happily merge :)
I did not find a way to distinguish RGBA from ARGB in hex form. If only to parse a string like rgba(r,g,b,a).
Well, as unfortunate as it is right now, switching from ARGB to RGBA will cause breakage. And a lot of breakage. I don't see how this could be changed without breaking everything already written.
I will try to investigate how much actual damage that might cause. If it doesn't do too much, maybe RGBA can be used.
On a sidenote, I will probably deprecate the function all together, and then make parseCSSColor
instead, to avoid any confusion
I added parseCSSColor
function, but I couldn't deprecate the parseHexColor
. Dlangui relies on ARGB too much internally so it's not viable to change everything right now.
https://github.com/buggins/dlangui/blob/51d1eabb8d9b1265f3253d518c742db51f5cbf5f/src/dlangui/graphics/colors.d#L316 Almost everywhere, and even more so in css engines, RGBA is used, it is extremely inconvenient to use ARGB when it is so rare.