(int c1, int c2, float weight)
| 3 | public class Color { |
| 4 | // TODO premultiply, alpha |
| 5 | public static int makeLerp(int c1, int c2, float weight) { |
| 6 | int r = (int) (getR(c1) * weight + getR(c2) * (1 - weight)); |
| 7 | int g = (int) (getG(c1) * weight + getG(c2) * (1 - weight)); |
| 8 | int b = (int) (getB(c1) * weight + getB(c2) * (1 - weight)); |
| 9 | return makeRGB(r, g, b); |
| 10 | } |
| 11 | |
| 12 | public static int makeARGB(int a, int r, int g, int b) { |
| 13 | assert 0 <= a && a <= 255 : "Alpha is out of 0..255 range: " + a; |