I'm not sure exactly what you're trying to do or if this will apply to messagemode but here's a more efficient way of storing RGB values.
PHP Code:
//Sample color values
new R = 125;
new G = 220;
new B = 53;
//Variable to store our RGB values
new RGB = ( R << 16 ) | ( G << 8 ) | B;
//Retrieve individual R, G, & B values from RGB variable
R = RGB >> 16;
G = ( RGB >> 8 ) & ~0xFF00;
B = RGB & ~0xFFFF00;
__________________