code: def test_colormap_interpolation():
      """Test interpolation routines for colormaps."""
      import vispy.color.colormap as c
  
      assert_raises(
          AssertionError,
          c._glsl_step,
          [0.0, 1.0],
      )
  
      for fun in (c._glsl_step, c._glsl_mix):
          assert_raises(
              AssertionError,
              fun,
              controls=[0.1, 1.0],
          )
          assert_raises(
              AssertionError,
              fun,
              controls=[0.0, 0.9],
          )
          assert_raises(
              AssertionError,
              fun,
              controls=[0.1, 0.9],
          )
  
      # Interpolation tests.
      color_0 = np.array([1.0, 0.0, 0.0])
      color_1 = np.array([0.0, 1.0, 0.0])
      color_2 = np.array([0.0, 0.0, 1.0])
  
      colors_00 = np.vstack((color_0, color_0))
      colors_01 = np.vstack((color_0, color_1))
      colors_11 = np.vstack((color_1, color_1))
      # colors_012 = np.vstack((color_0, color_1, color_2))
      colors_021 = np.vstack((color_0, color_2, color_1))
  
      controls_2 = np.array([0.0, 1.0])
      controls_3 = np.array([0.0, 0.25, 1.0])
      x = np.array([-1.0, 0.0, 0.1, 0.4, 0.5, 0.6, 1.0, 2.0])[:, None]
  
      mixed_2 = c.mix(colors_01, x, controls_2)
      mixed_3 = c.mix(colors_021, x, controls_3)
  
      for y in mixed_2, mixed_3:
          assert_allclose(y[:2, :], colors_00)
          assert_allclose(y[-2:, :], colors_11)
  
      assert_allclose(mixed_2[:, -1], np.zeros(len(y)))
  
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 5 for calling a global function with example usage: test_colormap_interpolation() without return types