I am facing a peculiar problem Here it is...
I have a hexdecimal integer, eg
int data = 0x5a0060;
This hexadecimal integer is of the form 0xRRGGBB
, which means that "5a" corresponds to RR , "00" to GG and "60" to BB.
Now in the program I want to access the respective integer(or hexa) values of RR, GG and BB. Means I want to extract the respective values of RR, GG, BB components from the input "data" hexadecimal integer. I have spent a lot of time figuring how to separate them( R G and B) , but couldn't find the solution. So friends I request to help me.
(And this 0xRRGGBB as hexadecimal integer is standard input. I can't play with it. )