Revision: 7025
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7025&view=rev
Author: efiring
Date: 2009-04-05 02:16:44 +0000 (Sun, 05 Apr 2009)
Log Message:
-----------
Fix PatchCollection bug 2732455 by letting to_rgba handle 'none'
Modified Paths:
--------------
branches/v0_98_5_maint/lib/matplotlib/colors.py
Modified: branches/v0_98_5_maint/lib/matplotlib/colors.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/colors.py 2009-04-05 01:37:26 UTC
(rev 7024)
+++ branches/v0_98_5_maint/lib/matplotlib/colors.py 2009-04-05 02:16:44 UTC
(rev 7025)
@@ -318,10 +318,18 @@
Returns an *RGBA* tuple of four floats from 0-1.
For acceptable values of *arg*, see :meth:`to_rgb`.
+ In addition, if *arg* is "none" (case-insensitive),
+ then (0,0,0,0) will be returned.
If *arg* is an *RGBA* sequence and *alpha* is not *None*,
*alpha* will replace the original *A*.
"""
try:
+ if arg.lower() == 'none':
+ return (0.0, 0.0, 0.0, 0.0)
+ except AttributeError:
+ pass
+
+ try:
if not cbook.is_string_like(arg) and cbook.iterable(arg):
if len(arg) == 4:
if [x for x in arg if (float(x) < 0) or (x > 1)]:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins