|
6 | 6 | Matplotlib recognizes the following formats to specify a color:
|
7 | 7 |
|
8 | 8 | * an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g., ``(0.1, 0.2, 0.5)``
|
9 |
| - or ``(0.1, 0.2, 0.5, 0.3)``); |
| 9 | + or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha; |
10 | 10 | * a hex RGB or RGBA string (e.g., ``'#0F0F0F'`` or ``'#0F0F0F0F'``);
|
11 | 11 | * a string representation of a float value in ``[0, 1]`` inclusive for gray
|
12 | 12 | level (e.g., ``'0.5'``);
|
|
23 | 23 | the indexing occurs at artist creation time and defaults to black if the
|
24 | 24 | cycle does not include color.
|
25 | 25 |
|
| 26 | +"Red", "Green" and "Blue", are the intensities of those colors, the combination |
| 27 | +of which span the colorspace. |
| 28 | +
|
| 29 | +How "Alpha" behaves depends on the ``zorder`` of the Artist. Higher |
| 30 | +``zorder`` Artists are drawn on top of lower Artists, and "Alpha" determines |
| 31 | +whether the lower artist is covered by the higher. |
| 32 | +If the old RGB of a pixel is ``RGBold`` and the RGB of the |
| 33 | +pixel of the Artist being added is ``RGBnew`` with Alpha ``alpha``, |
| 34 | +then the RGB of the pixel is updated to: |
| 35 | +``RGB = RGBOld * (1 - Alpha) + RGBnew * Alpha``. Alpha |
| 36 | +of 1 means the old color is completely covered by the new Artist, Alpha of 0 |
| 37 | +means that pixel of the Artist is transparent. |
| 38 | +
|
26 | 39 | All string specifications of color, other than "CN", are case-insensitive.
|
27 | 40 |
|
28 | 41 | "CN" color selection
|
|
0 commit comments