Skip to content

Icon: warn for wrong color value #1099

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

Merged
merged 1 commit into from
Mar 17, 2019

Conversation

Conengmo
Copy link
Member

The Icon class has two color arguments: one for the marker, one for the icon. The color for the icon can be a color name or any hex color. The color for the marker must be one of a set of values, otherwise the color will default to red.

This PR adds a check on the color argument a user provides. If it is not in the set of allowed colors, a warning is raised.

I used a warning instead of an exception because even with a wrong color value the map will render normally and it will display without errors. The color will just not be as expected.

@Conengmo Conengmo added the waiting for review PR is waiting to be reviewed label Mar 16, 2019
@Conengmo
Copy link
Member Author

@ocefpaf what do you think, useful or unnecessary?

@ocefpaf
Copy link
Member

ocefpaf commented Mar 17, 2019

@ocefpaf what do you think, useful or unnecessary?

It is something nice to have. Let's merge it!

@ocefpaf ocefpaf merged commit 3c70918 into python-visualization:master Mar 17, 2019
@Conengmo
Copy link
Member Author

Thanks!

@Conengmo Conengmo deleted the icon-color-warnings branch March 17, 2019 14:25
@Conengmo Conengmo removed the waiting for review PR is waiting to be reviewed label Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants