Skip to content

Commit

Permalink
Use hex colors in overlastgebieden.map
Browse files Browse the repository at this point in the history
Purely code cosmetics. No more bit fiddling in the generating script,
and we use hex colors elsewhere. They're arguably easier to read for web
designers.
  • Loading branch information
lbam committed Nov 15, 2023
1 parent ec56a93 commit 544b6cf
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 76 deletions.
9 changes: 3 additions & 6 deletions gen_overlastgebieden.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
q("ows_abstract", "Overlastgebieden")

for name, basename, color in layers:
color = f"{(color>>16) & 0xff} {(color>>8) & 0xff} {color & 0xff}"

with block("LAYER"):
p("NAME", name)
p("GROUP", "overlastgebieden")
Expand All @@ -59,15 +57,14 @@
p("NAME", name.replace("-", "_").title().replace("_", ""))
with block("STYLE"):
p("ANTIALIAS true")
p(f"COLOR {color}")
p(f'COLOR "#{color:06x}"')
p("OPACITY 20")
with block("STYLE"):
p(f"OUTLINECOLOR {color}")
p(f'OUTLINECOLOR "#{color:06x}"')
p("WIDTH 2")

for name, basename, color in layers:
name += "_label"
color = f"{(color>>16) & 0xff} {(color>>8) & 0xff} {color & 0xff}"

with block("LAYER"):
p("NAME", name)
Expand Down Expand Up @@ -104,7 +101,7 @@
if minscale is not None:
p("MINSCALEDENOM", minscale)
p("MAXSCALEDENOM", maxscale)
p(f"COLOR {color}")
p(f'COLOR "#{color:06x}"')
p("OUTLINECOLOR 255 255 255")
p("OUTLINEWIDTH 1")
p("FONT", "Ubuntu-M")
Expand Down
Loading

0 comments on commit 544b6cf

Please sign in to comment.