Is it possible to select transparent colors using built in
<input type="color">
I haven't found a slider that does that. Is there some option additional I need to check?
To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).
Setting Transparent Boxes You can set the CSS transparent background for boxes by adding the opacity property to multiple <div> elements. Tip: you should notice that texts inside boxes take the opacity of the CSS transparent background. The RGBA function allows you to keep the text opacity.
AFAIK there's no option for transparent color picking using <input type="color">
, but what you could do is have another input for the alpha, and set the opacity of the color input like this:
function updateColorAlpha (alpha) {
document.getElementById('color').style.opacity = alpha;
}
<input type="color" id="color">
<input type="range" id="alpha" onchange="updateColorAlpha(this.value);" min="0" max="1" step="0.1" value="1">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With