/** * Returns a "brighter" color. * * @param c The color. * @return A brighter color. */ private Color getBrighterColor(Color c) { if (brighterColors==null) { brighterColors = new HashMap<Color, Color>(5); // Usually small } Color brighter = brighterColors.get(c); if (brighter==null) { // Don't use c.brighter() as it doesn't work well for blue, and // also doesn't return something brighter "enough." int r = possiblyBrighter(c.getRed()); int g = possiblyBrighter(c.getGreen()); int b = possiblyBrighter(c.getBlue()); brighter = new Color(r, g, b); brighterColors.put(c, brighter); } return brighter; }
/** * Returns a "brighter" color. * * @param c The color. * @return A brighter color. */ private Color getBrighterColor(Color c) { if (brighterColors==null) { brighterColors = new HashMap<Color, Color>(5); // Usually small } Color brighter = brighterColors.get(c); if (brighter==null) { // Don't use c.brighter() as it doesn't work well for blue, and // also doesn't return something brighter "enough." int r = possiblyBrighter(c.getRed()); int g = possiblyBrighter(c.getGreen()); int b = possiblyBrighter(c.getBlue()); brighter = new Color(r, g, b); brighterColors.put(c, brighter); } return brighter; }
/** * Returns a "brighter" color. * * @param c The color. * @return A brighter color. */ private Color getBrighterColor(Color c) { if (brighterColors==null) { brighterColors = new HashMap(5); // Usually small } Color brighter = (Color)brighterColors.get(c); if (brighter==null) { // Don't use c.brighter() as it doesn't work well for blue, and // also doesn't return something brighter "enough." int r = possiblyBrighter(c.getRed()); int g = possiblyBrighter(c.getGreen()); int b = possiblyBrighter(c.getBlue()); brighter = new Color(r, g, b); brighterColors.put(c, brighter); } return brighter; }