mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-22 19:51:53 +02:00
27 lines
468 B
JavaScript
27 lines
468 B
JavaScript
|
|
||
|
/* IMPORT */
|
||
|
|
||
|
import {describe} from 'fava';
|
||
|
import {lightness} from '../../dist/index.js';
|
||
|
|
||
|
/* MAIN */
|
||
|
|
||
|
describe ( 'lightness', it => {
|
||
|
|
||
|
it ( 'gets the lightness channel of the color', t => {
|
||
|
|
||
|
const tests = [
|
||
|
['hsl(10, 20%, 30%)', 30],
|
||
|
['rgb(10, 20, 30)', 7.8431372549],
|
||
|
['rgb(0, 0, 0)', 0],
|
||
|
['#102030', 12.5490196078]
|
||
|
];
|
||
|
|
||
|
tests.forEach ( ([ color, output ]) => {
|
||
|
t.is ( lightness ( color ), output );
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|