Commit d9b8020
committed
FIX: Error-handling for from_list inputs
Assume that the 'colors' argument is always a list of colors.
If 'to_rgba_array' fails, attempt to unpack the values as a list of
'(color, value)' tuples.
Fixes matplotlib#29042. Passing '(color, alpha)' tuples are nor correctly parsed
as a list of colors.
Check for range and monotony of values when unpacking (value, color)
pairs.
Implemented tests for different combinations of inputs.1 parent b358c98 commit d9b8020
2 files changed
+52
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
1094 | | - | |
| 1094 | + | |
| 1095 | + | |
1095 | 1096 | | |
1096 | 1097 | | |
1097 | 1098 | | |
1098 | 1099 | | |
1099 | 1100 | | |
1100 | 1101 | | |
1101 | 1102 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1107 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1108 | 1122 | | |
1109 | | - | |
1110 | 1123 | | |
1111 | 1124 | | |
1112 | 1125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
0 commit comments