fork download
  1. import java.awt.*;
  2.  
  3. class Example {
  4. public static void main (String[] args) {
  5. Color c = new Color(100, 100, 100);
  6. int argb = ( c.getAlpha() * 16777216 ) +
  7. ( c.getRed() * 65536 ) +
  8. ( c.getGreen() * 256 ) +
  9. ( c.getBlue() );
  10. // this should print true
  11. System.out.println(argb == c.getRGB());
  12. }
  13. }
Success #stdin #stdout 0.13s 4390912KB
stdin
Standard input is empty
stdout
true