class_docstr: Tests the ColorPalette object
docstr: Test the conversion of a ColorPalette to hex values and back to rgb
docstr_tok: ["Test","the","conversion","of","a","ColorPalette","to","hex","values","and","back","to","rgb"]
code: def test_as_hex_as_rgb(self):
      """
      Test the conversion of a ColorPalette to hex values and back to rgb
      """
      palette = color_palette("flatui")
      expected = PALETTES["flatui"]
      morgified = palette.as_hex()
  
      assert morgified is not palette
      assert isinstance(morgified, ColorPalette)
      assert morgified == expected
  
      remorgified = morgified.as_rgb()
      assert remorgified is not morgified
      assert remorgified is not palette
      assert remorgified == palette
  
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 4 for calling the TestColorPaletteObject obj's underlying member method code with example usage: obj.test_as_hex_as_rgb() without return types