This is probably easy, but I'm trying to convert from a source which provides colors in RGB strings to an output in BGR strings in Java. I've been busting my brain and time on shifting and Long.decode and Long.toHexString.
Feel free to also throw alpha values in there (RGBA -> ABGR), though I think I can extend the principles.
I can assume that the hex is in the form specified in the long and int decode:
0x HexDigits
0X HexDigits
# HexDigits