(int color, int r)
| 46 | } |
| 47 | |
| 48 | public static int withR(int color, int r) { |
| 49 | assert 0 <= r && r <= 255 : "Red is out of 0..255 range: " + r; |
| 50 | return ((r & 0xFF) << 16) | (color & 0xFF00FFFF); |
| 51 | } |
| 52 | |
| 53 | public static int withG(int color, int g) { |
| 54 | assert 0 <= g && g <= 255 : "Green is out of 0..255 range: " + g; |