from matplotlib.colors import CSS4_COLORS as hexcolors from matplotlib.colors import to_rgb COLORS = {} for name, color in hexcolors.items(): COLORS[name] = [int(c * 255) for c in to_rgb(color)]
def test_css_named_colors_from_mpl_present(): from matplotlib.colors import CSS4_COLORS as mpl_colors pd_colors = CSSToExcelConverter.NAMED_COLORS for name, color in mpl_colors.items(): assert name in pd_colors and pd_colors[name] == color[1:]