Ignore:
Timestamp:
2012-11-12T21:38:11+01:00 (13 years ago)
Author:
bastiK
Message:

fixed #8187 - eval(#colour) doesn't result in #colour value suitable for color

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r4280 r5577  
    2626import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.LinkSelector;
    2727import org.openstreetmap.josm.tools.Pair;
     28import org.openstreetmap.josm.tools.Utils;
    2829
    2930public class MapCSSParser {
     
    553554        f=ufloat() { return f; }
    554555    |
    555         t=<HEXCOLOR>
    556             {
    557                 String clr = t.image.substring(1);
    558                 if (clr.length() == 3) {
    559                     clr = new String(new char[] {clr.charAt(0),clr.charAt(0),clr.charAt(1),clr.charAt(1),clr.charAt(2),clr.charAt(2)});
    560                 }
    561                 if (clr.length() != 6)
    562                     throw new AssertionError();
    563                 return new Color(Integer.parseInt(clr, 16));
    564             }
     556        t=<HEXCOLOR> { return Utils.hexToColor(t.image); }
    565557}
    566558
Note: See TracChangeset for help on using the changeset viewer.