@@ -88,164 +88,5 @@ public void SanitizeXmlValueAttributeTest(string givenPrePostFix, int charToEsca
8888 Workbook givenWorkbook = TestUtils . WriteAndReadWorkbook ( workbook ) ;
8989 Assert . Equal ( expectedText , givenWorkbook . CurrentWorksheet . SheetName ) ;
9090 }
91-
92- [ Fact ]
93- public void styleTest ( )
94- {
95- Workbook wb = new Workbook ( @"C:\purge-temp\test1\files\styleTest1.xlsx" , "worksheet1" ) ;
96- Style s1 = new Style ( ) ;
97- SrgbColor c1 = new SrgbColor ( "FFCC34AF" ) ;
98- s1 . CurrentFill . SetColor ( c1 , Fill . FillType . FillColor ) ;
99- wb . CurrentWorksheet . AddCell ( "SRGB(FFCC34AF) - Fill" , "A1" , s1 ) ;
100-
101- Style s2 = new Style ( ) ;
102- SrgbColor c2 = new SrgbColor ( "FFAADD00" ) ;
103- s2 . CurrentFill . SetColor ( c2 , Fill . FillType . PatternColor ) ;
104- s2 . CurrentFill . PatternFill = Fill . PatternValue . MediumGray ;
105- wb . CurrentWorksheet . AddCell ( "SRGB(FFAADD00) - Pattern" , "A2" , s2 ) ;
106-
107- Style s3 = new Style ( ) ;
108- IndexedColor c3 = new IndexedColor ( IndexedColor . Value . DarkTeal ) ;
109- s3 . CurrentFill . SetColor ( c3 , Fill . FillType . FillColor ) ;
110- wb . CurrentWorksheet . AddCell ( "Indexed(DarkTeal) - Fill" , "A3" , s3 ) ;
111-
112- Style s4 = new Style ( ) ;
113- IndexedColor c4 = new IndexedColor ( IndexedColor . Value . Rose ) ;
114- s4 . CurrentFill . SetColor ( c4 , Fill . FillType . PatternColor ) ;
115- s4 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
116- wb . CurrentWorksheet . AddCell ( "Indexed(Rose) - Pattern" , "A4" , s4 ) ;
117-
118- Style s5 = new Style ( ) ;
119- ThemeColor c5 = new ThemeColor ( Theme . ColorSchemeElement . Accent1 ) ;
120- s5 . CurrentFill . SetColor ( c5 , Fill . FillType . FillColor ) ;
121- wb . CurrentWorksheet . AddCell ( "Theme(Accent1) - Fill" , "A5" , s5 ) ;
122-
123- Style s6 = new Style ( ) ;
124- ThemeColor c6 = new ThemeColor ( Theme . ColorSchemeElement . Light1 ) ;
125- s6 . CurrentFill . SetColor ( c6 , Fill . FillType . PatternColor ) ;
126- s6 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
127- wb . CurrentWorksheet . AddCell ( "Theme(Light1) - Pattern" , "A6" , s6 ) ;
128-
129- Style s7 = new Style ( ) ;
130- AutoColor c7 = new AutoColor ( ) ;
131- s7 . CurrentFill . SetColor ( c7 , Fill . FillType . FillColor ) ;
132- wb . CurrentWorksheet . AddCell ( "Auto - Fill" , "A7" , s7 ) ;
133-
134- Style s8 = new Style ( ) ;
135- AutoColor c8 = new AutoColor ( ) ;
136- s8 . CurrentFill . SetColor ( c8 , Fill . FillType . PatternColor ) ;
137- s8 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
138- wb . CurrentWorksheet . AddCell ( "Auto(LightGray Pattern) - Pattern" , "A8" , s8 ) ;
139-
140- Style s9 = new Style ( ) ;
141- SrgbColor c9 = new SrgbColor ( "FFCC34AF" ) ;
142- s9 . CurrentFont . ColorValue = Color . CreateRgb ( c9 ) ;
143- wb . CurrentWorksheet . AddCell ( "SRGB(FFCC34AF) - Font" , "B1" , s9 ) ;
144-
145- Style s10 = new Style ( ) ;
146- IndexedColor c10 = new IndexedColor ( IndexedColor . Value . Salmon ) ;
147- s10 . CurrentFont . ColorValue = Color . CreateIndexed ( c10 ) ;
148- wb . CurrentWorksheet . AddCell ( "Indexed(Salmon) - Font" , "B2" , s10 ) ;
149-
150- Style s11 = new Style ( ) ;
151- ThemeColor c11 = new ThemeColor ( Theme . ColorSchemeElement . Hyperlink ) ;
152- s11 . CurrentFont . ColorValue = Color . CreateTheme ( c11 ) ;
153- wb . CurrentWorksheet . AddCell ( "Theme(Hyperlink) - Font" , "B3" , s11 ) ;
154-
155- Style s12 = new Style ( ) ;
156- SystemColor c12 = new SystemColor ( SystemColor . Value . ScrollBar ) ;
157- s12 . CurrentFont . ColorValue = Color . CreateSystem ( c12 ) ;
158- wb . CurrentWorksheet . AddCell ( "System(ScrollBar) - Font" , "B4" , s12 ) ;
159-
160- Style s13 = new Style ( ) ;
161- s13 . CurrentFont . ColorValue = 63 ; // Color.CreateAuto();
162- wb . CurrentWorksheet . AddCell ( "Auto - Font" , "B5" , s13 ) ;
163-
164- // ---
165-
166- Style s100 = new Style ( ) ;
167- SrgbColor c100 = new SrgbColor ( "FFCC34AF" ) ;
168- s100 . CurrentFill . SetColor ( c100 , Fill . FillType . FillColor ) ;
169- s100 . CurrentFill . ForegroundColor . Tint = 0.75 ;
170- wb . CurrentWorksheet . AddCell ( "SRGB(FFCC34AF) - Fill" , "C1" , s100 ) ;
171-
172- Style s200 = new Style ( ) ;
173- SrgbColor c200 = new SrgbColor ( "FFAADD00" ) ;
174- s200 . CurrentFill . SetColor ( c200 , Fill . FillType . PatternColor ) ;
175- s200 . CurrentFill . PatternFill = Fill . PatternValue . MediumGray ;
176- s200 . CurrentFill . BackgroundColor . Tint = 0.75 ;
177- wb . CurrentWorksheet . AddCell ( "SRGB(FFAADD00) - Pattern" , "C2" , s200 ) ;
178-
179- Style s300 = new Style ( ) ;
180- IndexedColor c300 = new IndexedColor ( IndexedColor . Value . DarkTeal ) ;
181- s300 . CurrentFill . SetColor ( c300 , Fill . FillType . FillColor ) ;
182- s300 . CurrentFill . ForegroundColor . Tint = - 0.75 ;
183- wb . CurrentWorksheet . AddCell ( "Indexed(DarkTeal) - Fill" , "C3" , s300 ) ;
184-
185- Style s400 = new Style ( ) ;
186- IndexedColor c400 = new IndexedColor ( IndexedColor . Value . Rose ) ;
187- s400 . CurrentFill . SetColor ( c400 , Fill . FillType . PatternColor ) ;
188- s400 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
189- s400 . CurrentFill . BackgroundColor . Tint = - 0.75 ;
190- wb . CurrentWorksheet . AddCell ( "Indexed(Rose) - Pattern" , "C4" , s400 ) ;
191-
192- Style s500 = new Style ( ) ;
193- ThemeColor c500 = new ThemeColor ( Theme . ColorSchemeElement . Accent1 ) ;
194- s500 . CurrentFill . SetColor ( c5 , Fill . FillType . FillColor ) ;
195- s500 . CurrentFill . ForegroundColor . Tint = 0.333 ;
196- wb . CurrentWorksheet . AddCell ( "Theme(Accent1) - Fill" , "C5" , s500 ) ;
197-
198- Style s600 = new Style ( ) ;
199- ThemeColor c600 = new ThemeColor ( Theme . ColorSchemeElement . Light1 ) ;
200- s600 . CurrentFill . SetColor ( c600 , Fill . FillType . PatternColor ) ;
201- s600 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
202- s600 . CurrentFill . BackgroundColor . Tint = - 0.333 ;
203- wb . CurrentWorksheet . AddCell ( "Theme(Light1) - Pattern" , "C6" , s600 ) ;
204-
205- Style s700 = new Style ( ) ;
206- AutoColor c700 = new AutoColor ( ) ;
207- s700 . CurrentFill . SetColor ( c700 , Fill . FillType . FillColor ) ;
208- s700 . CurrentFill . ForegroundColor . Tint = 0.5 ;
209- wb . CurrentWorksheet . AddCell ( "Auto - Fill" , "C7" , s700 ) ;
210-
211- Style s800 = new Style ( ) ;
212- AutoColor c800 = new AutoColor ( ) ;
213- s800 . CurrentFill . SetColor ( c800 , Fill . FillType . PatternColor ) ;
214- s800 . CurrentFill . PatternFill = Fill . PatternValue . LightGray ;
215- s800 . CurrentFill . BackgroundColor . Tint = - 0.5 ;
216- wb . CurrentWorksheet . AddCell ( "Auto(LightGray Pattern) - Pattern" , "C8" , s800 ) ;
217-
218- Style s900 = new Style ( ) ;
219- SrgbColor c900 = new SrgbColor ( "FFCC34AF" ) ;
220- s900 . CurrentFont . ColorValue = Color . CreateRgb ( c900 ) ;
221- s900 . CurrentFont . ColorValue . Tint = 0.25 ;
222- wb . CurrentWorksheet . AddCell ( "SRGB(FFCC34AF) - Font" , "D1" , s900 ) ;
223-
224- Style s1000 = new Style ( ) ;
225- IndexedColor c1000 = new IndexedColor ( IndexedColor . Value . Salmon ) ;
226- s1000 . CurrentFont . ColorValue = Color . CreateIndexed ( c1000 ) ;
227- s1000 . CurrentFont . ColorValue . Tint = - 0.25 ;
228- wb . CurrentWorksheet . AddCell ( "Indexed(Salmon) - Font" , "D2" , s1000 ) ;
229-
230- Style s1100 = new Style ( ) ;
231- ThemeColor c1100 = new ThemeColor ( Theme . ColorSchemeElement . Hyperlink ) ;
232- s1100 . CurrentFont . ColorValue = Color . CreateTheme ( c1100 ) ;
233- s1100 . CurrentFont . ColorValue . Tint = 0.95 ;
234- wb . CurrentWorksheet . AddCell ( "Theme(Hyperlink) - Font" , "D3" , s1100 ) ;
235-
236- Style s1200 = new Style ( ) ;
237- SystemColor c1200 = new SystemColor ( SystemColor . Value . ScrollBar ) ;
238- s1200 . CurrentFont . ColorValue = Color . CreateSystem ( c1200 ) ;
239- s1200 . CurrentFont . ColorValue . Tint = - 0.95 ;
240- wb . CurrentWorksheet . AddCell ( "System(ScrollBar) - Font" , "D4" , s1200 ) ;
241-
242- Style s1300 = new Style ( ) ;
243- s1300 . CurrentFont . ColorValue = 63 ; // Color.CreateAuto();
244- s1300 . CurrentFont . ColorValue . Tint = 0.86 ;
245- wb . CurrentWorksheet . AddCell ( "Auto - Font" , "D5" , s1300 ) ;
246-
247- wb . Save ( ) ;
248- }
249-
25091 }
25192}
0 commit comments