long RGB = (R << 16) | (G << 8) | B;
The reason your code only showed 'FF' instead of the expected 'FF00FF':
byte << int results in an 16-bit int. If you shift the byte left by 16 (as in R) it gets shifted off the end.
Use byte << 16L to get a long int (32-bit) result which will hold the 24-bit result:
long RGB = (R << 16L) | (G << 8) | B;
You were getting 0x0000 | 0xGG00 | 0x00BB = 0xGGBB which prints as 'FF'.
What you wanted was 0x00RR0000 | 0xGG00 | 0x00BB = 0x00RRGGZBB which prints as 'FF00FF'.
You can't pass a 24-bit value to a functions that use an int. SOMETHING is way wrong. What function are you trying to pass RGB to?