alpha-paintlet
alpha-paintlet copied to clipboard
A CSS Paint worklet that converts alpha's your bg-color based on some variables.
alpha-paintlet
A CSS Paint worklet that takes a background color and an alpha color and makes creates an alpha background.
Usage
Include the Paint worklet in your JS...
CSS.paintWorklet.addModule('path/to/alpha.js')
Then in your CSS...
#my-div {
--bg-color: #FF0000; /* rbg/hsl/etc value */
--bg-alpha: 0.23;
background: paint(alpha)
}