BUG: Limited available colors by ma3da · Pull Request #38247 · pandas-dev/pandas (original) (raw)

Two small scripts used for that.

from pandas.io.formats.excel import CSSToExcelConverter
from matplotlib.colors import CSS4_COLORS

# check if existing colors match the ones of matplotlib
for name, color in CSSToExcelConverter.NAMED_COLORS.items():
    assert "#" + color == CSS4_COLORS[name]

# generate code for CSSToExcelConverter
for name, color in CSS4_COLORS.items():
    print(f'"{name}": "{color[1:]}",')