It depends on the format. If you only want to keep the red, and the colors are stored nibble-wise RGBA RRGGBBAA
, then color & 0xFF000000
will mask out all the other colors. If you want to know the red value for that same format, (color >> 24) & 0xFF
will get it.