Is "int2rgb" an OK method name? All colors can be represented by an int, and often you want to get the individual red, green and blue values from that int.

I have a method int2rgb (and another called rgb2int) that does this. Is this a clear/good name?

public static int[] int2rgb(final int color) {
    return new int[] { (color &gt;&gt; 16) &amp; 0xFF, (color &gt;&gt; 8) &amp; 0xFF, color &amp; 0xFF };
}

public static int rgb2int(final int red, final int green, final int blue) {
    return (red &lt;&lt; 16) + (green &lt;&lt; 8) + blue;
}

public static int rgb2int(final int[] color) {
    return (color[0] &lt;&lt; 16) + (color[1] &lt;&lt; 8) + color[2];
}


And in case you are interested, the rest of the class is here.
As far as naming is concerned: Using 2 instead of to is pretty much a no-no - "to" is spelled out everywhere in the Java standard library. Further Java's naming convention is to capitalize every word, but the first in method names - except for acronyms which are all-caps no matter where they appear in the name. So the methods should be called intToRGB and RGBtoInt (to is lower case because it directly follows an acronym - compare for example Color.RGBtoHSB in the java standard library).

In regards to the code: I'd recommend representing your colors as Color objects rather than 3-element arrays. If you choose to do that, you don't have to define any of your methods, because that functionality already exists in the Color class.