<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_hex(self):
 """ Return a color palette with hex codes instead of RGB values. """

        hex = [mpl.colors.rgb2hex(rgb) for rgb in self]
        return ColorPalette(hex)