class_docstr: Test utilities used with colormaps.
class_docstr_tok: ["Test","utilities","used","with","colormaps","."]
docstr: Test that colors can be a list/tuple.
code: def test_cmap_list(self):
      """Test that colors can be a list/tuple."""
      from satpy.enhancements import create_colormap
  
      colors = [
          [0, 0, 1],
          [1, 0, 1],
          [0, 1, 1],
          [1, 1, 1],
      ]
      values = [2, 4, 6, 8]
      cmap = create_colormap({"colors": colors, "color_scale": 1})
      assert cmap.colors.shape[0] == 4
      np.testing.assert_equal(cmap.colors[0], [0.0, 0.0, 1.0])
      assert cmap.values.shape[0] == 4
      assert cmap.values[0] == 0
      assert cmap.values[-1] == 1.0
  
      cmap = create_colormap(
          {"colors": colors, "color_scale": 1, "values": values}
      )
      assert cmap.colors.shape[0] == 4
      np.testing.assert_equal(cmap.colors[0], [0.0, 0.0, 1.0])
      assert cmap.values.shape[0] == 4
      assert cmap.values[0] == 2
      assert cmap.values[-1] == 8
  
imports: import contextlib
  import os
  from tempfile import NamedTemporaryFile
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.enhancements import create_colormap, on_dask_array, on_separate_bands, using_map_blocks
label_desc: Use image node_id 8 for calling the TestColormapLoading obj's underlying member method code with example usage: obj.test_cmap_list() without return types