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

Improve color handling #114

Merged
merged 1 commit into from
Feb 26, 2018
Merged

Improve color handling #114

merged 1 commit into from
Feb 26, 2018

Conversation

pantierra
Copy link
Contributor

@pantierra pantierra commented Dec 23, 2017

This is the implementation of #104 to improve color handling and move essential parts into the core part of osm2gtfs. This PR includes:

  • Line objects' route_color attributes are now a hex value (and shouldn't be different things).
  • Data from OSM with colour information is sanitized (checked and eventually converted from W3C color names to hex values).
  • The route_text_color can be obtained from OSM by using the ref:colour_tx tag. This seems to be the most appropriate, when looking at the wiki. Of course creators are free to use any other tag.
  • If no information on the text color has been found in OSM; the standard RoutesCreator computes it's own route_text_color, based on a smart logic found by @ialokim and implemented within the helper function calculate_color_of_contrast. Of course creators can override this standard creator behaviour to define the colors and the logic as they want/need.

This PR is based on #99 (data structure).

@pantierra pantierra changed the title Color handling Improve color handling Dec 23, 2017
@pantierra pantierra mentioned this pull request Dec 23, 2017
Copy link
Contributor

@ialokim ialokim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice, thanks @xamanu !

@pantierra pantierra requested a review from grote January 5, 2018 19:14
@pantierra pantierra added the ready label Jan 6, 2018
@pantierra
Copy link
Contributor Author

Rebased on latest upstream master branch

Copy link
Owner

@grote grote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me!

@ialokim
Copy link
Contributor

ialokim commented Feb 15, 2018

I've only rebased on current master and squashed the two commits into one. I think this is really ready to be merged!

@grote grote merged commit 1b0c2e8 into grote:master Feb 26, 2018
@ialokim ialokim deleted the color-handling branch February 26, 2018 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants