diff options
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r-- | src/jrummikub/view/impl/StonePainter.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java index f795eea..9bdca05 100644 --- a/src/jrummikub/view/impl/StonePainter.java +++ b/src/jrummikub/view/impl/StonePainter.java @@ -21,20 +21,29 @@ class StonePainter { private static final float CIRCLE_POS = 0.725f; private static final float CIRCLE_WIDTH = 0.45f; - private static final Color BACKGROUND_COLOR = new Color(0.9f, 0.9f, 0.6f); private static final Color HIGHLIGHTED_COLOR = BACKGROUND_COLOR.darker(); + private static final float BRIGHTER_SCALE = 1.15f; + public static final float BOARD_SCALE = 75.0f*ASPECT_RATIO/DEFAULT_WIDTH; + private float scale; private static int even(float f) { return 2*(int)(f/2); } - - + + private static Color brighter(Color color) { + int r = (int) (color.getRed() * BRIGHTER_SCALE); + int g = (int) (color.getRed() * BRIGHTER_SCALE); + int b = (int) (color.getRed() * BRIGHTER_SCALE); + + return new Color(r>255?255:r, g>255?255:g, b>255?255:b); + } + private static Color getColor(StoneColor color) { switch(color) { case BLACK: @@ -81,14 +90,14 @@ class StonePainter { g.fillRect(x, y, width, height); // Paint bevel border - g.setColor(background.brighter().brighter()); + g.setColor(brighter(brighter(background))); g.fillRect(x, y, 1, height); - g.setColor(background.brighter()); + g.setColor(brighter(background)); g.fillRect(x+1, y+1, 1, height-2); - g.setColor(background.brighter().brighter()); + g.setColor(brighter(brighter(background))); g.fillRect(x, y, width, 1); - g.setColor(background.brighter()); + g.setColor(brighter(background)); g.fillRect(x+1, y+1, width-2, 1); g.setColor(background.darker().darker()); @@ -184,7 +193,7 @@ class StonePainter { g.setColor(background.darker()); g.drawArc(x+width/2-size/2, pos-size/2, size, size, 50, 170); - g.setColor(background.brighter()); + g.setColor(brighter(background)); g.drawArc((int)(x+width/2-size/2), pos-size/2, size, size, -130, 170); } |