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/tools/ColorHelper.java

    r16293 r16319  
    33
    44import java.awt.Color;
    5 
    6 import org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors;
    75
    86/**
     
    1614
    1715    /**
    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.
    1917     * @param html the color code
    2018     * @return the color
     
    3028        }
    3129        if (html.length() != 6 && html.length() != 8)
    32             return CSSColors.get(html);
     30            return null;
    3331        try {
    3432            return new Color(
     
    3836                    html.length() == 8 ? Integer.parseInt(html.substring(6, 8), 16) : 255);
    3937        } catch (NumberFormatException e) {
    40             return CSSColors.get(html);
     38            return null;
    4139        }
    4240    }
Note: See TracChangeset for help on using the changeset viewer.