@@ -221,7 +221,7 @@ def _is_nth_color(c):
221
221
222
222
223
223
def is_color_like (c ):
224
- """Return whether *c* can be interpreted as an RGB(A) color."""
224
+ """Return whether *c* as a valid Matplotlib :mpltype:` color` specifier ."""
225
225
# Special-case nth color syntax because it cannot be parsed during setup.
226
226
if _is_nth_color (c ):
227
227
return True
@@ -306,7 +306,7 @@ def to_rgba(c, alpha=None):
306
306
307
307
Parameters
308
308
----------
309
- c : Matplotlib color or ``np.ma.masked``
309
+ c : :mpltype:` color` or ``np.ma.masked``
310
310
311
311
alpha : float, optional
312
312
If *alpha* is given, force the alpha value of the returned RGBA tuple
@@ -447,7 +447,7 @@ def to_rgba_array(c, alpha=None):
447
447
448
448
Parameters
449
449
----------
450
- c : Matplotlib color or array of colors
450
+ c : :mpltype:` color` or list of :mpltype:`color` or RGB(A) array
451
451
If *c* is a masked array, an `~numpy.ndarray` is returned with a
452
452
(0, 0, 0, 0) row for each masked value or row in *c*.
453
453
@@ -550,7 +550,11 @@ def to_rgba_array(c, alpha=None):
550
550
551
551
552
552
def to_rgb (c ):
553
- """Convert *c* to an RGB color, silently dropping the alpha channel."""
553
+ """
554
+ Convert the :mpltype:`color` *c* to an RGB color tuple.
555
+
556
+ If c has an alpha channel value specified, that is silently dropped.
557
+ """
554
558
return to_rgba (c )[:3 ]
555
559
556
560
@@ -560,7 +564,7 @@ def to_hex(c, keep_alpha=False):
560
564
561
565
Parameters
562
566
----------
563
- c : :ref :`color <colors_def> ` or `numpy.ma.masked`
567
+ c : :mpltype :`color` or `numpy.ma.masked`
564
568
565
569
keep_alpha : bool, default: False
566
570
If False, use the ``#rrggbb`` format, otherwise use ``#rrggbbaa``.
@@ -1198,7 +1202,7 @@ class ListedColormap(Colormap):
1198
1202
1199
1203
Parameters
1200
1204
----------
1201
- colors : list, array
1205
+ colors : list of :mpltype:`color` or array
1202
1206
Sequence of Matplotlib color specifications (color names or RGB(A)
1203
1207
values).
1204
1208
name : str, optional
@@ -1857,12 +1861,12 @@ def with_extremes(self, *, bad=None, outside=None, shape=None, origin=None):
1857
1861
1858
1862
Parameters
1859
1863
----------
1860
- bad : None or :mpltype:`color`
1861
- If Matplotlib color , the *bad* value is set accordingly in the copy
1864
+ bad : :mpltype:`color`, optional
1865
+ If given , the *bad* value is set accordingly in the copy.
1862
1866
1863
- outside : None or :mpltype:`color`
1864
- If Matplotlib color and shape is 'ignore' or 'circleignore', values
1865
- *outside* the colormap are colored accordingly in the copy
1867
+ outside : :mpltype:`color`, optional
1868
+ If given and shape is 'ignore' or 'circleignore', values
1869
+ *outside* the colormap are colored accordingly in the copy.
1866
1870
1867
1871
shape : {'square', 'circle', 'ignore', 'circleignore'}
1868
1872
0 commit comments