from openpyxl import load_workbook from openpyxl.styles import PatternFill, colors excel_address = "openpyxl.xlsx" wb = load_workbook(excel_address) sht = wb["sheet"] sht["A1"].fill = PatternFill("solid", fgColor="1874CD") sht["A3"].fill = PatternFill("solid", fgColor="BCEE68") sht["A5"].fill = PatternFill("solid", fgColor=colors.RED) sht["A7"].fill = PatternFill("solid", fgColor=colors.GREEN) wb.save(excel_address)
RGB颜色原地址:http://www.114la.com/other/rgb.htm
RGB颜色查询对照表 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|