class_docstr: Tests the color_palette function.
docstr: Test converting a color palette to hex and back to rgb.
docstr_tok: ["Test","converting","a","color","palette","to","hex","and","back","to","rgb","."]
code: def test_as_hex(self):
      """
      Test converting a color palette to hex and back to rgb.
      """
      pal = color_palette("accent")
      for rgb, hex in zip(pal, pal.as_hex()):
          assert mpl.colors.rgb2hex(rgb) == hex
  
      for rgb_e, rgb_v in zip(pal, pal.as_hex().as_rgb()):
          assert rgb_e == rgb_v
  
imports: import pytest
  import numpy
  import matplotlib
  from yellowbrick.exceptions import *
  from yellowbrick.style.palettes import *
  from yellowbrick.style.colors import get_color_cycle
  from yellowbrick.style.rcmod import set_aesthetic, set_palette
  from yellowbrick.style.palettes import color_sequence, color_palette
  from yellowbrick.style.palettes import ColorPalette, PALETTES, SEQUENCES
  from tests.base import VisualTestCase
label_desc: Use image node_id 13 for calling the TestColorPaletteFunction obj's underlying member method code with example usage: obj.test_as_hex() without return types