From 3ece904b0082f4d63afe0d795b61c860d0790c83 Mon Sep 17 00:00:00 2001 From: GaoFei Date: Sat, 15 Oct 2022 00:03:49 +0800 Subject: This closes #1369, support set, and get font color with theme and tint (#1370) --- cell.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cell.go') diff --git a/cell.go b/cell.go index 80eb035..550ca38 100644 --- a/cell.go +++ b/cell.go @@ -823,6 +823,10 @@ func getCellRichText(si *xlsxSI) (runs []RichTextRun) { font.Strike = v.RPr.Strike != nil if v.RPr.Color != nil { font.Color = strings.TrimPrefix(v.RPr.Color.RGB, "FF") + if v.RPr.Color.Theme != nil { + font.ColorTheme = v.RPr.Color.Theme + } + font.ColorTint = v.RPr.Color.Tint } run.Font = &font } @@ -879,9 +883,7 @@ func newRpr(fnt *Font) *xlsxRPr { if fnt.Size > 0 { rpr.Sz = &attrValFloat{Val: &fnt.Size} } - if fnt.Color != "" { - rpr.Color = &xlsxColor{RGB: getPaletteColor(fnt.Color)} - } + rpr.Color = newFontColor(fnt) return &rpr } -- cgit v1.2.1