0

If I have a color:

int color = 0x1a2cf3bb; // just an example

How can I change, for examle, just the R channel with the value:

int red = 0xfe; // another example

So that color becomes:

color = 0x1afef3bb;
Adam Stelmaszczyk
  • 19,665
  • 4
  • 70
  • 110

1 Answers1

1
int result = (color & 0xff00ffff) | red;
Adam Stelmaszczyk
  • 19,665
  • 4
  • 70
  • 110