-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made some line-colors dependent on their polygon-fill #564
Conversation
Objects with the following tags have now a border-color, that depends on the polygons fill-color: leisure=swimming_pool/playground/track/pitch tourism=camp_site/caravan_site/picnic_site landuse=field/retail natural=field power=station/generator/sub_station/substation amenity=parking aeroway=aerodrome The dependency of both colors was expressed by adding: line-color: saturate(darken(@color, x%), y%) with 40 <= x <= 60 and 0 <= y <= 30
I think it is generally a good idea to have a default like this to calculate the outline color for filled areas. In special cases this could still be overwritten with a hard coded outline color |
Sounds great to me! |
…nt on their polygon-fill Affected tags: * building=* * aeroway=terminal * railway=station * amenity=place_of_worship
Good to hear that you support this change. One point I wanted to note is: There are some borders which would change colors with this PR (mostly from some sort of grey to a more saturated color). But I tried to reach a compromise between leaving the colors as they are and unifying the relation between polygon-fill and line-color.
Sure, one example is amenity=university/school, which I excluded from 611f4fe, because the current line-color (brown) is too different from the polygon-fill (#f0f0d8). |
i tested this and looked at the code. I recommend this to be merged. |
👍 in principle to this idea, haven't reviewed the code. I was going this direction in the buildings code, as it makes it a lot easier than copying hex values to/from gimp/photoshop as I adjust everything, and it makes it clear what is happening than the different hex values. |
It is worth noting that transformations like this should generally be carried out in Lab or Luv/Lch colour-space, not HSL, which is what
Wikipedia has more background and links to papers. I'm still not opposed to this, but we do need to be aware that it's not actually making it any easier for someone else to change the colours properly. In my work to make landuse more consistent so #565 becomes easier, I'm ending up copying/pasting from a colour picker that works in Lch, because that's the easiest way to get the two colours to match in apparent lightness but differ in hue/chroma. On the other hand, it makes a quick change where you aren't as concerned about the particulars much easier. |
Thanks for this hint, I wasn't aware of that before. Using Lab/Luv/Lch would surely be the best solution in terms of the appearance of the result, but as you said it has to be done manually in an external program and copied back as for instance a hex-value. If you do that, maybe it would be a good idea to share instructions on how this color was determined, e.g. But I think for now In conclusion, I really like your idea of using better color spaces than HSL, as it would produce the best results. But for the moment I think it is a step in the right direction to use the color operation functions. |
Yes - it is very clear. I should note that my comment above was made in the middle of 2-3 hours of adjusting colours in Lch/Luv colour space, converting them to/from RGB (in decimal and hex) and computing perceptual differences between colours to make sure there was sufficient difference.
What I'm wondering is, having done the above, should I compute the |
@math1985 I'm working on it just now :-) |
I've kept @pnorman's changes to the retail landuse, but merged the rest of the changes in this request. |
I worked on resolving issue #57.
Objects with the following tags have now a border-color, that depends on the polygons fill-color:
The dependency of both colors was expressed by adding:
with 40 <= x <= 60
and 0 <= y <= 30
In my opinion this improves both the appearance and maintainability, because there is one variable per selector to define the colors of polygon-fill and line-color.
What do you think: Is this approach desirable for this mapstyle, or should the line-color rather be left hardcoded?