code: def test_color_conversion():
      """Test color conversions"""
      # HSV
      # test known values
      test = ColorArray()
      for key in hsv_dict:
          c = ColorArray(key)
          test.hsv = hsv_dict[key]
          assert_allclose(c.RGB, test.RGB, atol=1)
      test.value = 0
      assert_equal(test.value, 0)
      assert_equal(test, ColorArray("black"))
      c = ColorArray("black")
      assert_array_equal(c.hsv.ravel(), (0, 0, 0))
      rng = np.random.RandomState(0)
      for _ in range(50):
          hsv = rng.rand(3)
          hsv[0] *= 360
          hsv[1] = hsv[1] * 0.99 + 0.01  # avoid ugly boundary effects
          hsv[2] = hsv[2] * 0.99 + 0.01
          c.hsv = hsv
          assert_allclose(c.hsv.ravel(), hsv, rtol=1e-4, atol=1e-4)
  
      # Lab
      test = ColorArray()
      for key in lab_dict:
          c = ColorArray(key)
          test.lab = lab_dict[key]
          assert_allclose(c.rgba, test.rgba, atol=1e-4, rtol=1e-4)
          assert_allclose(
              test.lab.ravel(), lab_dict[key], atol=1e-4, rtol=1e-4
          )
      for _ in range(50):
          # boundaries can have ugly rounding errors in some parameters
          rgb = rng.rand(3)[np.newaxis, :] * 0.9 + 0.05
          c.rgb = rgb
          lab = c.lab
          c.lab = lab
          assert_allclose(c.lab, lab, atol=1e-4, rtol=1e-4)
          assert_allclose(c.rgb, rgb, atol=1e-4, rtol=1e-4)
  
file_path: vispy/vispy/color/tests/test_color.py
imports: import numpy
  from numpy.testing import assert_array_equal, assert_allclose
  from vispy.color import Color, ColorArray, get_color_names, Colormap, get_color_dict, get_colormap, get_colormaps
  from vispy.visuals.shaders import Function
  from vispy.util import use_log_level
  from vispy.testing import run_tests_if_main, assert_equal, assert_raises, assert_true
label_desc: Use image node_id 4 for calling a global function with example usage: test_color_conversion() without return types