Files
infocom-systems-design/node_modules/khroma/test/methods/is_transparent.js
2025-10-03 22:27:28 +03:00

34 lines
650 B
JavaScript

/* IMPORT */
import {describe} from 'fava';
import {isTransparent} from '../../dist/index.js';
/* MAIN */
describe ( 'isTransparent', it => {
it ( 'checks if the provided color is a transparent color', t => {
const tests = [
['transparent', true],
['#00000000', true],
['#ffffff00', true],
['black', false],
['#00000001', false],
['#ffffffff', false],
['#8a8a8a', false],
['#bbbbbb', false],
['#ffcc00', false],
['#e0e0e0', false],
['#ffffff', false]
];
tests.forEach ( ([ color, output ]) => {
t.is ( isTransparent ( color ), output );
});
});
});