@@ -275,12 +275,32 @@ describe('#convert', function () {
275
275
} ) ;
276
276
} ) ;
277
277
278
+ describe ( 'tint with alpha' , function ( ) {
279
+ it ( 'should blend a color with white and adjust the alpha' , function ( ) {
280
+ convert ( 'red a(40%) tint(50%)' , 'rgba(255, 128, 128, 0.4)' ) ;
281
+ } ) ;
282
+
283
+ it ( 'should blend a color with white and adjust the alpha' , function ( ) {
284
+ convert ( 'red tint(50%) a(20%)' , 'rgba(255, 128, 128, 0.2)' ) ;
285
+ } ) ;
286
+ } ) ;
287
+
278
288
describe ( 'shade' , function ( ) {
279
289
it ( 'should blend a color with black' , function ( ) {
280
290
convert ( 'red shade(50%)' , 'rgb(128, 0, 0)' ) ;
281
291
} ) ;
282
292
} ) ;
283
293
294
+ describe ( 'shade with alpha' , function ( ) {
295
+ it ( 'should blend a color with black and adjust the alpha' , function ( ) {
296
+ convert ( 'red a(40%) shade(50%)' , 'rgba(128, 0, 0, 0.4)' ) ;
297
+ } ) ;
298
+
299
+ it ( 'should blend a color with black and adjust the alpha' , function ( ) {
300
+ convert ( 'red shade(50%) a(25%)' , 'rgba(128, 0, 0, 0.25)' ) ;
301
+ } ) ;
302
+ } ) ;
303
+
284
304
describe ( 'contrast' , function ( ) {
285
305
it ( 'should darken the same hue with a light color' , function ( ) {
286
306
convert ( 'hwb(180, 10%, 0%) contrast(0%)' , 'rgb(13, 115, 115)' ) ; // hwb(180, 5%, 55%)
@@ -299,6 +319,16 @@ describe('#convert', function () {
299
319
} ) ;
300
320
} ) ;
301
321
322
+ describe ( 'contrast with alpha' , function ( ) {
323
+ it ( 'should go to white with a dark color and the given alpha' , function ( ) {
324
+ convert ( 'black a(40%) contrast(99%)' , 'rgba(255, 255, 255, 0.4)' ) ;
325
+ } ) ;
326
+
327
+ it ( 'should go to black with a light color and the given alpha' , function ( ) {
328
+ convert ( 'white a(50%) contrast(99%)' , 'rgba(0, 0, 0, 0.5)' ) ;
329
+ } ) ;
330
+ } ) ;
331
+
302
332
describe ( 'nested color functions' , function ( ) {
303
333
it ( 'should convert nested color functions' , function ( ) {
304
334
convert ( 'color(rebeccapurple a(- 10%)) a(- 10%)' , 'rgba(102, 51, 153, 0.81)' ) ;
0 commit comments