code: def test_check_color():
      """Test color format."""
      assert _check_color("red") == (1.0, 0.0, 0.0)
      assert _check_color((0.0, 1.0, 0.0, 1.0)) == (0.0, 1.0, 0.0, 1.0)
      assert _check_color((0, 0, 255, 255)) == (0, 0, 255, 255)
      with pytest.raises(ValueError, match="RGB or RGBA"):
          _check_color([255, 0])
      with pytest.raises(ValueError, match="out of range"):
          _check_color([256, 0, 0])
      with pytest.raises(ValueError, match="out of range"):
          _check_color([-1.0, 0.0, 0.0])
      with pytest.raises(TypeError, match="Expected data type"):
          _check_color(["foo", "bar", "foo"])
      with pytest.raises(TypeError, match="Expected type"):
          _check_color(None)
  
file_path: mne-python/mne/viz/backends/tests/test_utils.py
imports: import platform
  from colorsys import rgb_to_hls
  from contextlib import nullcontext
  import numpy
  import pytest
  from mne import create_info
  from mne.io import RawArray
  from mne.utils import _check_qt_version
  from mne.viz.backends._utils import _check_color, _get_colormap_from_array, _pixmap_to_ndarray, _qt_is_dark
label_desc: Use image node_id 2 for calling a global function with example usage: test_check_color() without return types