summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorEagle Xiang <eagle.xiang@outlook.com>2021-01-28 21:13:23 +0800
committerGitHub <noreply@github.com>2021-01-28 21:13:23 +0800
commit219add2f0e4ae591141330648d410b60f5c0dbcf (patch)
treeba4302ffc711ecba25cb822d6867a729454c3f8f /styles.go
parentb84bd1abc06457f6383013b8a600fc8c95eed2ed (diff)
value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause … (#770)
* value fields xlsxPatternFill.FgColor & xlsxPatternFill.BgColor cause ineffective omitempty tags * remove useless omitempty tag on xlsxPatternFill.FgColor and xlsxPatternFill.BgColor
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/styles.go b/styles.go
index c2dc7fa..9fd0f18 100644
--- a/styles.go
+++ b/styles.go
@@ -2432,8 +2432,14 @@ func newFills(style *Style, fg bool) *xlsxFill {
var pattern xlsxPatternFill
pattern.PatternType = patterns[style.Fill.Pattern]
if fg {
+ if pattern.FgColor == nil {
+ pattern.FgColor = new(xlsxColor)
+ }
pattern.FgColor.RGB = getPaletteColor(style.Fill.Color[0])
} else {
+ if pattern.BgColor == nil {
+ pattern.BgColor = new(xlsxColor)
+ }
pattern.BgColor.RGB = getPaletteColor(style.Fill.Color[0])
}
fill.PatternFill = &pattern