sass-planifolia

Vanilla Sass helper functions
git clone https://git.ce9e.org/sass-planifolia.git

commit
77ec7aeb4b410c475ec14ccf18497944e5b52129
parent
fb06223fe4f1ca5a37a9bc64bafb3e87f8faabb7
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2017-10-17 18:17
add hsl tests

Diffstat

M test/color.js 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

1 files changed, 98 insertions, 0 deletions


diff --git a/test/color.js b/test/color.js

@@ -268,4 +268,102 @@ describe('color', function() {
  268   268       });
  269   269     });
  270   270   });
   -1   271 
   -1   272   describe('hsl', function() {
   -1   273     describe('hsl', function() {
   -1   274       it('white', function() {
   -1   275         sassaby.func('lch').calledWithArgs('100', '0', '0', 'hsl').equals('white');
   -1   276       });
   -1   277       it('black', function() {
   -1   278         sassaby.func('lch').calledWithArgs('0', '0', '0', 'hsl').equals('black');
   -1   279       });
   -1   280     });
   -1   281 
   -1   282     describe('pf-lightness', function() {
   -1   283       it('white', function() {
   -1   284         sassaby.func('pf-lightness').calledWithArgs('white', 'hsl').equals(100);
   -1   285       });
   -1   286       it('black', function() {
   -1   287         sassaby.func('pf-lightness').calledWithArgs('black', 'hsl').equals(0);
   -1   288       });
   -1   289       it('red', function() {
   -1   290         sassaby.func('pf-lightness').calledWithArgs('red', 'hsl').equals(50);
   -1   291       });
   -1   292       it('blue', function() {
   -1   293         sassaby.func('pf-lightness').calledWithArgs('blue', 'hsl').equals(50);
   -1   294       });
   -1   295     });
   -1   296 
   -1   297     describe('pf-chroma', function() {
   -1   298       it('white', function() {
   -1   299         sassaby.func('pf-chroma').calledWithArgs('white', 'hsl').equals(0);
   -1   300       });
   -1   301       it('black', function() {
   -1   302         sassaby.func('pf-chroma').calledWithArgs('black', 'hsl').equals(0);
   -1   303       });
   -1   304       it('red', function() {
   -1   305         sassaby.func('pf-chroma').calledWithArgs('red', 'hsl').equals(100);
   -1   306       });
   -1   307       it('blue', function() {
   -1   308         sassaby.func('pf-chroma').calledWithArgs('blue', 'hsl').equals(100);
   -1   309       });
   -1   310     });
   -1   311 
   -1   312     describe('pf-hue', function() {
   -1   313       it('white', function() {
   -1   314         shared.similar(sassaby.func('pf-hue').calledWithArgs('white', 'hsl'), 0);
   -1   315       });
   -1   316       it('black', function() {
   -1   317         shared.similar(sassaby.func('pf-hue').calledWithArgs('black', 'hsl'), 0);
   -1   318       });
   -1   319       it('red', function() {
   -1   320         shared.similar(sassaby.func('pf-hue').calledWithArgs('red', 'hsl'), 0);
   -1   321       });
   -1   322       it('yellow', function() {
   -1   323         shared.similar(sassaby.func('pf-hue').calledWithArgs('yellow', 'hsl'), Math.PI / 3);
   -1   324       });
   -1   325       it('green', function() {
   -1   326         shared.similar(sassaby.func('pf-hue').calledWithArgs('green', 'hsl'), Math.PI / 3 * 2);
   -1   327       });
   -1   328       it('blue', function() {
   -1   329         shared.similar(sassaby.func('pf-hue').calledWithArgs('blue', 'hsl'), Math.PI / 3 * 4);
   -1   330       });
   -1   331     });
   -1   332 
   -1   333     describe('pf-complement', function() {
   -1   334       it('white', function() {
   -1   335         sassaby.func('pf-complement').calledWithArgs('white', 'hsl').equals('white');
   -1   336       });
   -1   337       it('red', function() {
   -1   338         sassaby.func('pf-complement').calledWithArgs('red', 'hsl').equals('cyan');
   -1   339       });
   -1   340       it('yellow', function() {
   -1   341         sassaby.func('pf-complement').calledWithArgs('yellow', 'hsl').equals('blue');
   -1   342       });
   -1   343     });
   -1   344 
   -1   345     describe('pf-mix', function() {
   -1   346       it('white, white', function() {
   -1   347         sassaby.func('pf-mix').calledWithArgs('white', 'white', '50%', 'hsl').equals('white');
   -1   348       });
   -1   349       it('black, white', function() {
   -1   350         sassaby.func('pf-mix').calledWithArgs('black', 'white', '50%', 'hsl').equals('gray');
   -1   351       });
   -1   352       it('black, white, 0%', function() {
   -1   353         sassaby.func('pf-mix').calledWithArgs('black', 'white', '0%', 'hsl').equals('white');
   -1   354       });
   -1   355       it('black, white, 100%', function() {
   -1   356         sassaby.func('pf-mix').calledWithArgs('black', 'white', '100%', 'hsl').equals('black');
   -1   357       });
   -1   358       it('blue, red', function() {
   -1   359         sassaby.func('pf-mix').calledWithArgs('blue', 'red', '50%', 'hsl').equals('magenta');
   -1   360       });
   -1   361       it('yellow, blue', function() {
   -1   362         sassaby.func('pf-mix').calledWithArgs('yellow', 'blue', '50%', 'hsl').equals('#00ff80');
   -1   363       });
   -1   364       it('white, blue', function() {
   -1   365         sassaby.func('pf-mix').calledWithArgs('white', 'blue', '50%', 'hsl').equals('#9f9fdf');
   -1   366       });
   -1   367     });
   -1   368   });
  271   369 });