MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _check_color_like

Function _check_color_like

lib/matplotlib/colors.py:271–284  ·  view source on GitHub ↗

For each *key, value* pair in *kwargs*, check that *value* is color-like.

(**kwargs)

Source from the content-addressed store, hash-verified

269
270
271def _check_color_like(**kwargs):
272 """
273 For each *key, value* pair in *kwargs*, check that *value* is color-like.
274 """
275 for k, v in kwargs.items():
276 if not is_color_like(v):
277 raise ValueError(
278 f"{v!r} is not a valid value for {k}: supported inputs are "
279 f"(r, g, b) and (r, g, b, a) 0-1 float tuples; "
280 f"'#rrggbb', '#rrggbbaa', '#rgb', '#rgba' strings; "
281 f"named color strings; "
282 f"string reprs of 0-1 floats for grayscale values; "
283 f"'C0', 'C1', ... strings for colors of the color cycle; "
284 f"and pairs combining one of the above with an alpha value")
285
286
287def same_color(c1, c2):

Callers

nothing calls this directly

Calls 1

is_color_likeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…