Changeset 16319 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2020-04-17T15:01:21+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ColorHelper.java
r16293 r16319 3 3 4 4 import java.awt.Color; 5 6 import org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors;7 5 8 6 /** … … 16 14 17 15 /** 18 * Returns the {@code Color} for the given HTML code , also evaluates CSS color names using {@link CSSColors}.16 * Returns the {@code Color} for the given HTML code. 19 17 * @param html the color code 20 18 * @return the color … … 30 28 } 31 29 if (html.length() != 6 && html.length() != 8) 32 return CSSColors.get(html);30 return null; 33 31 try { 34 32 return new Color( … … 38 36 html.length() == 8 ? Integer.parseInt(html.substring(6, 8), 16) : 255); 39 37 } catch (NumberFormatException e) { 40 return CSSColors.get(html);38 return null; 41 39 } 42 40 }
Note:
See TracChangeset
for help on using the changeset viewer.