luhn-generator
Version:
A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the 'modulus 10' or 'mod 10' algorithm
17 lines (14 loc) • 524 B
JavaScript
import elementHasImage from '../color/element-has-image';
import getOwnBackgroundColor from '../color/get-own-background-color';
/**
* Determines whether an element has a fully opaque background, whether solid color or an image
* @param {Element} node
* @return {Boolean} false if the background is transparent, true otherwise
*/
function isOpaque(node) {
const style = window.getComputedStyle(node);
return (
elementHasImage(node, style) || getOwnBackgroundColor(style).alpha === 1
);
}
export default isOpaque;