Ignore:
Timestamp:
2020-04-17T15:01:21+02:00 (4 years ago)
Author:
simon04
Message:

see #8352 - PropertiesDialog: fix 3-char CSS color names such as "red"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java

    r16315 r16319  
    1515import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority;
    1616import org.openstreetmap.josm.gui.MainApplication;
     17import org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors;
    1718import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
    1819import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
     
    135136
    136137    protected Color getColor() {
    137         return ColorHelper.html2color(String.valueOf(getSelectedItem()));
     138        String colorString = String.valueOf(getSelectedItem());
     139        return colorString.startsWith("#")
     140                ? ColorHelper.html2color(colorString)
     141                : CSSColors.get(colorString);
    138142    }
    139143
Note: See TracChangeset for help on using the changeset viewer.