I am using python 2.7 and xlwt module for excel export
I would like to set backgroung colour of a cell
i know i can use
style1 = xlwt.easyxf('pattern: pattern solid, fore_colour red;')
but I would like to set custom color smth. like #8a8eef
or is there a palette of possible colors, because light blue is not working :)
thank you
解决方案
If you are not using easyxf() and instead are building XFStyle object step by step, here is another way of using user friendly color names:
import xlwt
style = xlwt.XFStyle()
pattern = xlwt.Pattern()
pattern.pattern = xlwt.Pattern.SOLID_PATTERN
pattern.pattern_fore_colour = xlwt.Style.colour_map['dark_purple']
style.pattern = pattern