background-blend-mode-plus-lighter.html (1133B)
1 <!DOCTYPE html> 2 <title>background-blend-mode: plus-lighter test</title> 3 <link rel="author" title="Jake Archibald" href="mailto:jakearchibald@chromium.org"> 4 <link rel="help" href="https://drafts.fxtf.org/compositing-2/#background-blend-mode"> 5 <link rel="match" href="reference/background-blend-mode-plus-lighter-ref.html"> 6 <meta name="fuzzy" content="maxDifference=0-1;totalPixels=0-4294967295"> 7 <style> 8 .test { 9 width: 100px; 10 height: 100px; 11 background-blend-mode: plus-lighter; 12 } 13 </style> 14 <script type="module"> 15 import { tests } from '../support/plus-lighter.js'; 16 import { toCSSColor } from '../support/utils.js'; 17 18 // Create a solid color CSS image. 19 const colorImage = (pixel) => 20 `linear-gradient(to right, ${toCSSColor(pixel)}, ${toCSSColor(pixel)})`; 21 22 const createBackgrounds = (colors) => colors 23 // Backgrounds are top first 24 .slice().reverse() 25 .map((color) => colorImage(color)) 26 .join(', '); 27 28 for (const colors of tests) { 29 document.body.insertAdjacentHTML('beforeend', ` 30 <div class="test" style="background-image: ${createBackgrounds(colors)}"></div> 31 `); 32 } 33 </script>