remove _orig_color which is duplicate of _rgb#3683
remove _orig_color which is duplicate of _rgb#3683tacaswell merged 1 commit intomatplotlib:masterfrom
Conversation
|
@Westacular: Any thoughts? |
|
I was weighing writing a test that tests set_graylevel when I discovered that it doesn't appear to be called anywhere (aside from calling the base class in overrides). Since backends are not part of the surface area which anyone uses outside of the MPL library this leads me to believe that the set_graylevel method is now unnecessary. Would like your feedback on this .. @mdboom @tacaswell . Thanks. |
|
Searching gitk it appears it has never been called except by subclasses passing up the inheritance chain... There are user-defined backends out there in the wild so this will have to go through a deprecation cycle (document, at least one release cycle of raising a warning), but I'm in favor of getting rid of it. |
|
Just a historical note: color handling has long been a source of difficulty and confusion, largely because of the way alpha handling has evolved, combined with the original drawing model in mpl. The fact that postscript doesn't have transparency at all makes things worse. In retrospect, I suspect the inclusion of an alpha kwarg at the artist level is probably a design error, and working around it has led to some of the convoluted code you are stumbling over. Every now and then there has been a burst of effort to fix some of the problems, and usually that leads to the conclusion that a major revamp of color handling is in order; but obviously, none of us has gotten around to executing that. |
MNT : remove GraphicsContextBase._orig_color which is duplicate of _rgb This is a hold over from the old alpha handling code that is now redundant as we carry rgba values through out.
The GraphicsContextBase._orig_color member was introduced by 6cc8aaa , but I don't believe it is necessary. This patch removes that member and goes a small step further to put related special case in set_foreground.
This is a spin-off of #3393 where test coverage is a legit concern. A default tests.py run on my linux box covers all paths touched by this code with the exception of set_greylevel.