@@ -172,7 +172,7 @@ func TestSetConditionalFormat(t *testing.T) {
172172 // Test creating a conditional format with a solid color data bar style
173173 f := NewFile ()
174174 condFmts := []ConditionalFormatOptions {
175- {Type : "data_bar" , BarColor : "# A9D08E" , BarSolid : true , Format : intPtr (0 ), Criteria : "=" , MinType : "min" , MaxType : "max" },
175+ {Type : "data_bar" , BarColor : "A9D08E" , BarSolid : true , Format : intPtr (0 ), Criteria : "=" , MinType : "min" , MaxType : "max" },
176176 }
177177 for _ , ref := range []string {"A1:A2" , "B1:B2" } {
178178 assert .NoError (t , f .SetConditionalFormat ("Sheet1" , ref , condFmts ))
@@ -186,7 +186,7 @@ func TestSetConditionalFormat(t *testing.T) {
186186 ws , ok := f .Sheet .Load ("xl/worksheets/sheet1.xml" )
187187 assert .True (t , ok )
188188 ws .(* xlsxWorksheet ).ExtLst = & xlsxExtLst {Ext : fmt .Sprintf (`<ext uri="%s"><x14:slicerList /></ext><ext uri="%s"><x14:sparklineGroups /></ext>` , ExtURISlicerListX14 , ExtURISparklineGroups )}
189- assert .NoError (t , f .SetConditionalFormat ("Sheet1" , "A1:A2" , []ConditionalFormatOptions {{Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "# 0000FF" , BarColor : "# 638EC6" , BarSolid : true }}))
189+ assert .NoError (t , f .SetConditionalFormat ("Sheet1" , "A1:A2" , []ConditionalFormatOptions {{Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "0000FF" , BarColor : "638EC6" , BarSolid : true }}))
190190 f = NewFile ()
191191 // Test creating a conditional format with invalid extension list characters
192192 ws , ok = f .Sheet .Load ("xl/worksheets/sheet1.xml" )
@@ -202,9 +202,9 @@ func TestSetConditionalFormat(t *testing.T) {
202202 f := NewFile ()
203203 var condFmts []ConditionalFormatOptions
204204 for _ , color := range []string {
205- "# 264B96" , // Blue
206- "# F9A73E" , // Yellow
207- "# 006F3C" , // Green
205+ "264B96" , // Blue
206+ "F9A73E" , // Yellow
207+ "006F3C" , // Green
208208 } {
209209 condFmts = append (condFmts , ConditionalFormatOptions {
210210 Type : "data_bar" ,
@@ -267,10 +267,10 @@ func TestGetConditionalFormats(t *testing.T) {
267267 {{Type : "average" , AboveAverage : true , Format : & idx , Criteria : "=" }},
268268 {{Type : "duplicate" , Format : & idx , Criteria : "=" }},
269269 {{Type : "unique" , Format : & idx , Criteria : "=" }},
270- {{Type : "3_color_scale" , Criteria : "=" , MinType : "num" , MidType : "num" , MaxType : "num" , MinValue : "-10" , MidValue : "50" , MaxValue : "10" , MinColor : "# FF0000" , MidColor : "# 00FF00" , MaxColor : "# 0000FF" }},
271- {{Type : "2_color_scale" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinColor : "# FF0000" , MaxColor : "# 0000FF" }},
272- {{Type : "data_bar" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinValue : "-10" , MaxValue : "10" , BarBorderColor : "# 0000FF" , BarColor : "# 638EC6" , BarOnly : true , BarSolid : true , StopIfTrue : true }},
273- {{Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "# 0000FF" , BarColor : "# 638EC6" , BarDirection : "rightToLeft" , BarOnly : true , BarSolid : true , StopIfTrue : true }},
270+ {{Type : "3_color_scale" , Criteria : "=" , MinType : "num" , MidType : "num" , MaxType : "num" , MinValue : "-10" , MidValue : "50" , MaxValue : "10" , MinColor : "FF0000" , MidColor : "00FF00" , MaxColor : "0000FF" }},
271+ {{Type : "2_color_scale" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinColor : "FF0000" , MaxColor : "0000FF" }},
272+ {{Type : "data_bar" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinValue : "-10" , MaxValue : "10" , BarBorderColor : "0000FF" , BarColor : "638EC6" , BarOnly : true , BarSolid : true , StopIfTrue : true }},
273+ {{Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "0000FF" , BarColor : "638EC6" , BarDirection : "rightToLeft" , BarOnly : true , BarSolid : true , StopIfTrue : true }},
274274 {{Type : "formula" , Format : & idx , Criteria : "1" }},
275275 {{Type : "blanks" , Format : & idx }},
276276 {{Type : "no_blanks" , Format : & idx }},
@@ -312,8 +312,8 @@ func TestGetConditionalFormats(t *testing.T) {
312312 // Test get multiple conditional formats
313313 f = NewFile ()
314314 expected := []ConditionalFormatOptions {
315- {Type : "data_bar" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinValue : "-10" , MaxValue : "10" , BarBorderColor : "# 0000FF" , BarColor : "# 638EC6" , BarOnly : true , BarSolid : true , StopIfTrue : true },
316- {Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "# 0000FF" , BarColor : "# 638EC6" , BarDirection : "rightToLeft" , BarOnly : true , BarSolid : false , StopIfTrue : true },
315+ {Type : "data_bar" , Criteria : "=" , MinType : "num" , MaxType : "num" , MinValue : "-10" , MaxValue : "10" , BarBorderColor : "0000FF" , BarColor : "638EC6" , BarOnly : true , BarSolid : true , StopIfTrue : true },
316+ {Type : "data_bar" , Criteria : "=" , MinType : "min" , MaxType : "max" , BarBorderColor : "0000FF" , BarColor : "638EC6" , BarDirection : "rightToLeft" , BarOnly : true , BarSolid : false , StopIfTrue : true },
317317 }
318318 err = f .SetConditionalFormat ("Sheet1" , "A2:A1,B:B,2:2" , expected )
319319 assert .NoError (t , err )
0 commit comments