title: How to convert RGB to BGR?
body: <p>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. </p>
  
  <p>Feel free to also throw alpha values in there (RGBA -> ABGR), though I think I can extend the principles.</p>
  
  <p>I can assume that the hex is in the form specified in the long and int <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Long.html#decode%28java.lang.String%29" rel="nofollow noreferrer">decode</a>:</p>
  
  <pre><code>0x HexDigits  
  0X HexDigits 
  # HexDigits
  </code></pre>