Skip to content
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

How to change light yellow color of some streets? #27

Open
Datseris opened this issue Apr 4, 2022 · 8 comments
Open

How to change light yellow color of some streets? #27

Datseris opened this issue Apr 4, 2022 · 8 comments
Labels
enhancement New feature or request theming Themes, colours, waytypes, etc.

Comments

@Datseris
Copy link
Contributor

Datseris commented Apr 4, 2022

image

This light yellow color is barely visible so I'd like to change it for InteractiveDynamics.jl. I am not sure how to do that though. I had a look at the source code, and I believe I need to provide something to graphplotkwargs, but I am not sure what... What kind of street is the one that has this light yellow color...?

@fbanning
Copy link
Member

fbanning commented Apr 4, 2022

Theming support is not yet implemented. The default OSMMakie colours are defined here. How you'd like to do change the colours is up to you. You could either change specific entries of the OSMMakie.WAYTYPECOLORS dict or for those street colours that you dislike (recreate the map after doing this). Or you can simply leave the way colours as they are and instead choose another background colour for your map, e.g. a light grey as axis background, to get a better contrast with the default colourscheme.

@fbanning
Copy link
Member

fbanning commented Apr 4, 2022

Oh and if you find yourself creating a completely new theme, please consider contributing it here. Maybe that's a nice motivation for me to add basic theming support via a kwarg for osmplot. I would imagine something simple like theme = :default and then pass an existing theme name as symbol. :)

@Datseris
Copy link
Contributor Author

Datseris commented Apr 4, 2022

great thanks, I'll probably make a custom theme yeap, but it is not clear how I'd contribute it. I guess one option would be if there are keywords for WAYTYPECOLOR etc. accepted by osmplot?

p.s.: from all the possible streets, the ones plotted yellow above are which kind? Are they the "secondary"...?

@fbanning
Copy link
Member

fbanning commented Apr 4, 2022

from all the possible streets, the ones plotted yellow above are which kind? Are they the "secondary"...?

Well, I cannot tell that because I don't know which map you're using. You can just enable edge inspection and have a look yourself (the tags will tell you which waytype it is). Or you could just look at the theme and change every occurrence of this yellow colour to another colour of your liking (which is probably the easier way to do it).

@fbanning
Copy link
Member

fbanning commented Apr 4, 2022

I guess one option would be if there are keywords for WAYTYPECOLOR etc. accepted by osmplot?

Hm, I'd rather have a hybrid solution. My idea would be to just have a theme keyword argument for osmplot that accepts either a Symbol or a complete theme (e.g. Dict of the required theme specifications like WAYTYPECOLOR, etc.) as its value. If it's a symbol, it is then looked up in a dictionary of built-in themes. If it's a custom theme, it is used directly. Something along those lines.

@Datseris
Copy link
Contributor Author

Datseris commented Apr 4, 2022

BTW is there a reason to make the dictionary have colorant as a forced value? Anything that is valid and can be passed to to_color should be working downstream, no? I propose that the value type of WAYTYPECOLORS is Any. BTW, colorant"xxx" is not an accessible name by simply using CairoMakie, you need to call some additional package.

@fbanning
Copy link
Member

fbanning commented Apr 5, 2022

I propose that the value type of WAYTYPECOLORS is Any.

Good call, I'll change it accordingly once the work on theming has begun.

colorant"xxx" is not an accessible name by simply using CairoMakie, you need to call some additional package

using CairoMakie.Colors should do the job.

@fbanning fbanning added enhancement New feature or request theming Themes, colours, waytypes, etc. labels May 13, 2022
@Datseris
Copy link
Contributor Author

This is how I do it now:

default_colors = InteractiveDynamics.OSMMakie.WAYTYPECOLORS
default_colors["primary"] = colorant"#a1777f"
default_colors["secondary"] = colorant"#a18f78"
default_colors["tertiary"] = colorant"#b3b381"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request theming Themes, colours, waytypes, etc.
Projects
None yet
Development

No branches or pull requests

2 participants