4 ms·
int v = ((r << 24) & 0xff000000) | ((g << 16) & 0xff0000) | ((b << 8) & 0xff00) | ( a & 0xff) ; Is there a reason y
by thaumasiotes 11y ago
int v =
((r << 24) & 0xff000000) |
((g << 16) & 0xff0000) |
((b << 8) & 0xff00) |
( a & 0xff) ;
Is there a reason you're doing the shift before the mask? I find this much less intuitive than the equivalent
int v =
((r & 0xff) << 24) |
((g & 0xff) << 16) |
((b & 0xff) << 8) |
( a & 0xff) ;
- mzs 11y agoCause I was trying to exaggerate the effect of space to within reason somewhat? Cause it was like 1AM here when I wrote it? Take your pick ;) Yeah I'd totally write the bottom way I think, or I hope, cheers.