+package kaka.cakelight;
+
+public class Color {
+ private int r, g, b;
+
+ public static Color rgb(int r, int g, int b) {
+ Color c = new Color();
+ c.r = r;
+ c.g = g;
+ c.b = b;
+ return c;
+ }
+
+ public int r() {
+ return r;
+ }
+
+ public int g() {
+ return g;
+ }
+
+ public int b() {
+ return b;
+ }
+
+ public Color interpolate(Color other, double value) {
+ double invertedValue = 1 - value;
+ return Color.rgb(
+ (int)(r * invertedValue + other.r * value),
+ (int)(g * invertedValue + other.g * value),
+ (int)(b * invertedValue + other.b * value)
+ );
+ }
+}