code: def is_color(color):
      """
      Checks if supplied object is a valid color spec.
      """
      if not isinstance(color, str):
          return False
      elif RGB_HEX_REGEX.match(color):
          return True
      elif color in COLOR_ALIASES:
          return True
      elif color in cnames:
          return True
      return False
  
imports: import inspect
  import re
  import warnings
  import matplotlib
  import numpy
  from matplotlib import ticker, units
  from matplotlib.colors import Normalize, cnames
  from matplotlib.lines import Line2D
  from matplotlib.markers import MarkerStyle
  from matplotlib.patches import Path, PathPatch
  from matplotlib.rcsetup import validate_fontsize, validate_fonttype, validate_hatch
  from matplotlib.transforms import Affine2D, Bbox, TransformedBbox
  from packaging.version import Version
  from ...core.util import arraylike_types, cftime_types, is_number
  from ...element import RGB, Polygons, Raster
  from ..util import COLOR_ALIASES, RGB_HEX_REGEX
label_desc: Use image node_id 1 for calling a global function with example usage: is_color(color) and returns: False, False, True, True, True