1 --- src/ja/centre/gui/util/ColorUtil.java.old 2009-03-16 11:17:53.000000000 +0000
2 +++ src/ja/centre/gui/util/ColorUtil.java 2009-03-16 11:22:38.000000000 +0000
6 public static Color middle( Color color1, Color color2 ) {
8 - ( color1.getRed() + color2.getRed() ) >> 1,
9 - ( color1.getGreen() + color2.getGreen() ) >> 1,
10 - ( color1.getBlue() + color2.getBlue() ) >> 1,
11 - ( color1.getAlpha() + color2.getAlpha() ) >> 1 // TODO alpha should be calculated with proportions, result is lesser alpha
15 + return new Color((color1.getRed() + color2.getRed()) / 2, (color1.getGreen() + color2.getGreen()) / 2, (color1.getBlue() + color2.getBlue()) / 2, Math.min(color1.getAlpha(), color2.getAlpha()));