package main
import (
"fmt"
"github.com/360EntSecGroup-Skylar/excelize"
func main() {
f, _ := excelize.OpenFile("Book1.xlsx")
fmt.Println(getCellBgColor(f, "Sheet1", "C1"))
}
func getCellBgColor(f *excelize.File, sheet, axix string) string {
fgColor := f.Styles.Fills.Fill[fillID].PatternFill.FgColor
if fgColor.Theme != nil {
srgbClr := f.Theme.ThemeElements.ClrScheme.Children[*fgColor.Theme].SrgbClr.Val
return excelize.ThemeColor(srgbClr, fgColor.Tint)
}
return fgColor.RGB