Return whether *c* as a valid Matplotlib :mpltype:`color` specifier.
(c)
| 224 | |
| 225 | |
| 226 | def is_color_like(c): |
| 227 | """Return whether *c* as a valid Matplotlib :mpltype:`color` specifier.""" |
| 228 | # Special-case nth color syntax because it cannot be parsed during setup. |
| 229 | if _is_nth_color(c): |
| 230 | return True |
| 231 | try: |
| 232 | to_rgba(c) |
| 233 | except (TypeError, ValueError): |
| 234 | return False |
| 235 | else: |
| 236 | return True |
| 237 | |
| 238 | |
| 239 | def _has_alpha_channel(c): |
searching dependent graphs…