summaryrefslogtreecommitdiff
path: root/shape.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-09-26 22:28:14 +0800
committerxuri <xuri.me@gmail.com>2019-09-26 22:28:14 +0800
commiteb520ae27757d4bca276fa2894bf461d75df9b37 (patch)
tree5fa25471b3b6590f5314445b49f909002b2962cb /shape.go
parent475fbf3856dd83c4813874570ae5ae2cb48ed421 (diff)
Improve compatibility for charts
Diffstat (limited to 'shape.go')
-rw-r--r--shape.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/shape.go b/shape.go
index e6a2ff3..f284e43 100644
--- a/shape.go
+++ b/shape.go
@@ -411,11 +411,6 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format
U: u,
Sz: p.Font.Size * 100,
Latin: &aLatin{Typeface: p.Font.Family},
- SolidFill: &aSolidFill{
- SrgbClr: &attrValString{
- Val: strings.Replace(strings.ToUpper(p.Font.Color), "#", "", -1),
- },
- },
},
T: text,
},
@@ -423,6 +418,14 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format
Lang: "en-US",
},
}
+ srgbClr := strings.Replace(strings.ToUpper(p.Font.Color), "#", "", -1)
+ if len(srgbClr) == 6 {
+ paragraph.R.RPr.SolidFill = &aSolidFill{
+ SrgbClr: &attrValString{
+ Val: srgbClr,
+ },
+ }
+ }
shape.TxBody.P = append(shape.TxBody.P, paragraph)
}
twoCellAnchor.Sp = &shape