Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在尝试解决这个问题,基本上我想要一个整数,例如白色(16777215)转换回RGB(255,255,255),但我不知道如何。
我知道 R+(G*256)+(B*65536) = Integer 但我想要 Integer = R,G,B。
谢谢你提供的所有帮助!
int R = (i & 0x000000FF); int G = (i & 0x0000FF00) >> 8; int B = (i & 0x00FF0000) >> 16; int A = (i & 0xFF000000) >> 24;