Commit ee13342
committed
Make _get_rgba_face actually always return a RGBA.
_get_rgba_face is an internal function that is only use to set the
graphicscontext's foreground color (in Line2D.draw); it is always
effectively called as `gc.set_foreground(line._get_rgba_face(...),
isRGBA=True)`. So it makes sense to have it actually always return a
RGBA quadruplet, including when the color is "none" (in which case
`mcolors.to_rgba` returns (0, 0, 0, 0) regardless of alpha, which works
just fine).
This removes the need for third party graphicscontexts to handle
non-RGBA-quadruplets (specifically, None) even when set_foreground is
actually called with isRGBA=True.1 parent 0ddae6e commit ee13342
3 files changed
Lines changed: 37 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
499 | 499 | | |
500 | | - | |
501 | | - | |
| 500 | + | |
502 | 501 | | |
503 | 502 | | |
504 | | - | |
| 503 | + | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
514 | 516 | | |
515 | 517 | | |
516 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2766 | 2766 | | |
2767 | 2767 | | |
2768 | 2768 | | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
797 | | - | |
| 796 | + | |
798 | 797 | | |
799 | 798 | | |
800 | 799 | | |
801 | 800 | | |
802 | 801 | | |
803 | 802 | | |
804 | | - | |
805 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
832 | | - | |
| 831 | + | |
833 | 832 | | |
834 | 833 | | |
835 | 834 | | |
| |||
843 | 842 | | |
844 | 843 | | |
845 | 844 | | |
846 | | - | |
847 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
| 1260 | + | |
1267 | 1261 | | |
1268 | 1262 | | |
1269 | 1263 | | |
| |||
0 commit comments