@@ -230,6 +230,16 @@ void TestStyleV2::testParseColor()
230
230
colorTests.insert ( " 00ff000" , qMakePair ( QColor (), false ) );
231
231
colorTests.insert ( " fff" , qMakePair ( QColor ( 255 , 255 , 255 ), false ) );
232
232
colorTests.insert ( " fff0" , qMakePair ( QColor (), false ) );
233
+
234
+ // hex rrggbbaa colors
235
+ colorTests.insert ( " #ff00ffaa" , qMakePair ( QColor ( 255 , 0 , 255 , 170 ), true ) );
236
+ colorTests.insert ( " #99AA0099" , qMakePair ( QColor ( 153 , 170 , 0 , 153 ), true ) );
237
+ colorTests.insert ( " #GG0000aa" , qMakePair ( QColor (), false ) );
238
+ colorTests.insert ( " 00000000" , qMakePair ( QColor ( 0 , 0 , 0 , 0 ), true ) );
239
+ colorTests.insert ( " 00ff0011" , qMakePair ( QColor ( 0 , 255 , 0 , 17 ), true ) );
240
+ colorTests.insert ( " 00gg0011" , qMakePair ( QColor ( ), false ) );
241
+ colorTests.insert ( " 00ff00000" , qMakePair ( QColor (), false ) );
242
+
233
243
colorTests.insert ( " 0,0,0" , qMakePair ( QColor ( 0 , 0 , 0 ), false ) );
234
244
colorTests.insert ( " 127,60,0" , qMakePair ( QColor ( 127 , 60 , 0 ), false ) );
235
245
colorTests.insert ( " 255,255,255" , qMakePair ( QColor ( 255 , 255 , 255 ), false ) );
@@ -301,6 +311,16 @@ void TestStyleV2::testParseColorList()
301
311
colorTests.insert ( " 00ff000" , QColor () );
302
312
// colorTests.insert( "fff", QColor( 255, 255, 255 ) );
303
313
colorTests.insert ( " fff0" , QColor () );
314
+
315
+ // hex rrggbbaa colors
316
+ colorTests.insert ( " #ff00ffaa" , QColor ( 255 , 0 , 255 , 170 ) );
317
+ colorTests.insert ( " #99AA0099" , QColor ( 153 , 170 , 0 , 153 ) );
318
+ colorTests.insert ( " #GG0000aa" , QColor () );
319
+ colorTests.insert ( " 00000000" , QColor ( 0 , 0 , 0 , 0 ) );
320
+ colorTests.insert ( " 00ff0011" , QColor ( 0 , 255 , 0 , 17 ) );
321
+ colorTests.insert ( " 00gg0011" , QColor ( ) );
322
+ colorTests.insert ( " 00ff00000" , QColor () );
323
+
304
324
colorTests.insert ( " 0,0,0" , QColor ( 0 , 0 , 0 ) );
305
325
colorTests.insert ( " 127,60,0" , QColor ( 127 , 60 , 0 ) );
306
326
colorTests.insert ( " 255,255,255" , QColor ( 255 , 255 , 255 ) );
0 commit comments