Ignore:
Timestamp:
2014-01-19T20:30:57+01:00 (8 years ago)
Author:
simon04
Message:

fix #9191 - MapCSS: Add option to include colour preferences of external styles

The syntax is the same as for the XML styles: name#123456

File:
1 edited

Legend:

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

    r6686 r6740  
    2626import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector;
    2727import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.LinkSelector;
     28import org.openstreetmap.josm.tools.ColorHelper;
    2829import org.openstreetmap.josm.tools.Pair;
    2930import org.openstreetmap.josm.tools.Utils;
     
    585586{
    586587    String val;
    587     Token t;
     588    Token t, t2;
    588589    float f;
    589590}
    590591{
     592        LOOKAHEAD(2)
     593        t2=<IDENT> t=<HEXCOLOR>
     594        { return Main.pref.getColor("mappaint." + (sheet == null ? "MapCSS" : sheet.title) + "." + t2.image, ColorHelper.html2color(t.image)); }
     595    |
    591596        t=<IDENT> { return new Keyword(t.image); }
    592597    |
     
    597602        f=ufloat() { return f; }
    598603    |
    599         t=<HEXCOLOR> { return Utils.hexToColor(t.image); }
     604        t=<HEXCOLOR> { return ColorHelper.html2color(t.image); }
    600605}
    601606
Note: See TracChangeset for help on using the changeset viewer.