title: Java - Decimal color to RGB color
body: <p>I have a decimal (not hexadecimal) color code and, using Java, I need to convert it to the three RGB colors. </p>
  
  <p>So for example, 16777215 (pure white) needs to get converted to Red: 255 Green: 255 Blue: 255. <br>
  65280 (pure green) needs to get converted to Red: 0 Green 255: Blue: 0 <br><br><a href="http://www.mathsisfun.com/hexadecimal-decimal-colors.html" rel="noreferrer">Here</a> is a converter for more examples.
  <hr>
  Just doing some small calculations and playing with the calculator on the page linked above, I have determined:</p>
  
  <ul>
  <li>Red equals 65536 (256^2)
  <ul>
  <li>(255x65536 = 16711680, aka pure red)</li>
  </ul></li>
  <li>Green equals 256 (256^1)
  <ul>
  <li>(255x256 = 65280, aka pure green)</li>
  </ul></li>
  <li>Blue equals 1 (256^0)
  <ul>
  <li>(255x1 = 255, aka pure blue)</li>
  </ul></li>
  </ul>
  
  <p>I can tell it obviously has something to do with bytes, but I am missing that last little bit. I am not the best with the whole concept of bits/bytes/etc and how it interacts with Java, so it is likely fairly simple.</p>
  
  <p>So, anyone know the best way of going about this? What would be the best way to convert a single numerical decimal color into the three separate RGB values using java?</p>