Skip to content

Add method for comparing two colors #10032

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 3 commits into from
Dec 21, 2017
Merged

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Dec 17, 2017

Colors in Matplotlib can come in many weird and wonderful forms; this allows two colors to be compared.

@tacaswell tacaswell added this to the v2.2 milestone Dec 18, 2017
@WeatherGod
Copy link
Member

WeatherGod commented Dec 18, 2017 via email

@tacaswell
Copy link
Member

👍 @WeatherGod sorry I missed that.

Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

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

Looks reasonable; I wonder where it would be used, apart from the legend?

@dstansby
Copy link
Member Author

There might be other bits of the codebase that compare if two colors are equal?

Even if there aren't I think it's a useful user function to have given then many different ways colors can be specified, and it makes it clear in our internal code when we are comparing colors for equality.

Will add a what's new when I get time, or if someone wants to push one to my branch feel free.

@tacaswell
Copy link
Member

I think this is the first step towards a more consistent color representation at the python layer.

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Right - see #9995. It would prob make sense to have a color class that then did all this automagically.

@WeatherGod
Copy link
Member

WeatherGod commented Dec 18, 2017 via email

@jklymak jklymak merged commit af185be into matplotlib:master Dec 21, 2017
@dstansby dstansby deleted the same-color branch December 21, 2017 09:18
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

6 participants