HTMLInputElement: colorSpace property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
ThecolorSpace property of theHTMLInputElement interface reflects the<input> element'scolorspace attribute, which indicates whether thecolor space of the serialized CSS color issRGB (the default) ordisplay-p3. It is only relevant tocolor controls.
In this article
Value
A string containing the value of thecolorspace attribute.
Examples
>Getting and setting color spaces
html
<input type="color" colorspace="display-p3" alpha />js
const colorInput = document.getElementById("color-picker");console.log(colorInput.colorSpace); // "display-p3"colorInput.colorSpace = "limited-srgb"; // convert to srgbSpecifications
| Specification |
|---|
| HTML> # dom-input-colorspace> |