blowfish/node_modules/khroma/test/methods/blue.js

26 lines
402 B
JavaScript
Raw Normal View History

2023-01-29 22:30:24 +00:00
/* IMPORT */
import {describe} from 'fava';
import {blue} from '../../dist/index.js';
/* MAIN */
describe ( 'blue', it => {
it ( 'gets the blue channel of the color', t => {
const tests = [
['rgb(10, 20, 30)', 30],
['#102030', 48],
['hsl(10, 20%, 30%)', 61.2]
];
tests.forEach ( ([ color, output ]) => {
t.is ( blue ( color ), output );
});
});
});