From e07dac5c2e308c952c8fdec5e6ad7089ff432ccf Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 6 Aug 2022 15:23:03 +0800 Subject: Add new exported `ColorMappingType` used for color transformation Using `ColorMappingType` color transformation types enumeration for tab color index, ref #1285 --- sheetpr.go | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'sheetpr.go') diff --git a/sheetpr.go b/sheetpr.go index cc4e4a9..0e3cb9b 100644 --- a/sheetpr.go +++ b/sheetpr.go @@ -47,23 +47,6 @@ type ( OutlineSummaryBelow bool ) -const ( - TabColorThemeLight1 int = iota // Inverted compared to the spec because that's how Excel maps them - TabColorThemeDark1 - TabColorThemeLight2 - TabColorThemeDark2 - TabColorThemeAccent1 - TabColorThemeAccent2 - TabColorThemeAccent3 - TabColorThemeAccent4 - TabColorThemeAccent5 - TabColorThemeAccent6 - TabColorThemeHyperlink - TabColorThemeFollowedHyperlink - - TabColorUnsetValue int = -1 -) - // setSheetPrOption implements the SheetPrOption interface. func (o OutlineSummaryBelow) setSheetPrOption(pr *xlsxSheetPr) { if pr.OutlinePr == nil { @@ -165,7 +148,7 @@ func (o TabColorIndexed) setSheetPrOption(pr *xlsxSheetPr) { // TabColor Indexed. Defaults to -1 if no indexed has been set. func (o *TabColorIndexed) getSheetPrOption(pr *xlsxSheetPr) { if pr == nil || pr.TabColor == nil { - *o = TabColorIndexed(TabColorUnsetValue) + *o = TabColorIndexed(ColorMappingTypeUnset) return } *o = TabColorIndexed(pr.TabColor.Indexed) @@ -206,7 +189,7 @@ func (o TabColorTheme) setSheetPrOption(pr *xlsxSheetPr) { // TabColor Theme. Defaults to -1 if no theme has been set. func (o *TabColorTheme) getSheetPrOption(pr *xlsxSheetPr) { if pr == nil || pr.TabColor == nil { - *o = TabColorTheme(TabColorUnsetValue) + *o = TabColorTheme(ColorMappingTypeUnset) return } *o = TabColorTheme(pr.TabColor.Theme) -- cgit v1.2.1