// purpose: support color encoding decoding public class RGB { public static int getBlue( int c ) { int b = c % 256; return b; } public static int getGreen( int c ) { int n = c / 256; int g = n % 256; return g; } public static int getRed( int c ) { int n = c / ( 256 * 256 ); int r = n % 256; return r; } public static int toInt( int r, int g, int b ) { return (r * 256 * 256) + (g * 256 ) + b; } }