code: def color_check(plugin, fmt="png"):
      """Check roundtrip behavior for color images.
  
      All major input types should be handled as ubytes and read
      back correctly.
      """
      img = img_as_ubyte(data.chelsea())
      r1 = roundtrip(img, plugin, fmt)
      testing.assert_allclose(img, r1)
  
      img2 = img > 128
      r2 = roundtrip(img2, plugin, fmt)
      testing.assert_allclose(img2, r2.astype(bool))
  
      img3 = img_as_float(img)
      r3 = roundtrip(img3, plugin, fmt)
      testing.assert_allclose(r3, img)
  
      img4 = img_as_int(img)
      if fmt.lower() in (("tif", "tiff")):
          img4 -= 100
          r4 = roundtrip(img4, plugin, fmt)
          testing.assert_allclose(r4, img4)
      else:
          r4 = roundtrip(img4, plugin, fmt)
          testing.assert_allclose(r4, img_as_ubyte(img4))
  
      img5 = img_as_uint(img)
      r5 = roundtrip(img5, plugin, fmt)
      testing.assert_allclose(r5, img)
  
imports: import os
  import re
  import struct
  import threading
  import functools
  from tempfile import NamedTemporaryFile
  import numpy
  from numpy import testing
  from numpy.testing import TestCase, assert_, assert_warns, assert_no_warnings, assert_equal, assert_almost_equal, assert_array_equal, assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_array_less
  import warnings
  from ..None import data, io
  from ..data._fetchers import _fetch
  from ..util import img_as_uint, img_as_float, img_as_int, img_as_ubyte
  from ._warnings import expected_warnings
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: color_check(plugin, fmt) without return types