def overwrite_colors()

in chartify/_core/colors.py [0:0]


    def overwrite_colors(self):
        """Overwrite colors in the colour module with custom colors."""
        if not self.colors:
            return

        for color_rgb, color_name in self.colors.items():
            # Remove color from default names if it already exits.
            color_name = color_name.lower()
            if color_name in list(colour.COLOR_NAME_TO_RGB.keys()):
                delete_color_value = colour.COLOR_NAME_TO_RGB[color_name]
                del colour.RGB_TO_COLOR_NAMES[delete_color_value]
                del colour.COLOR_NAME_TO_RGB[color_name]
            colour.RGB_TO_COLOR_NAMES[color_rgb] = [color_name]

        colour.COLOR_NAME_TO_RGB = dict(
            (name.lower(), rgb) for rgb, names in list(colour.RGB_TO_COLOR_NAMES.items()) for name in names
        )