def METHOD_NAME(self, colordict: dict = None):
    """ Updates the colors in self.colordict and in surfaces_df.
    Args:
        colordict (dict, optional): dict with surface names mapped to hex
            color codes, e.g. {'layer1':'#6b0318'}. Defaults to None.
    """
    if colordict is None:
        self.generate_colordict()
    else:
        for surf, color in colordict.items():  # map new colors to surfaces
            # assert this because user can set it manually
            assert surf in list(self.surfaces.df['surface']), str(surf) + ' is not a model surface'
            assert re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', color), str(color) + ' is not a HEX color code'
            self.colordict[surf] = color
    self._set_colors()