HTMLInputElement: colorSpace property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The colorSpace property of the HTMLInputElement interface reflects the <input> element's colorspace attribute, which indicates whether the color space of the serialized CSS color is sRGB (the default) or display-p3. It is only relevant to color controls.

Value

A string containing the value of the colorspace attribute.

Examples

Getting and setting color spaces

html
<input id="color-picker" 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 srgb

Specifications

Specification
HTML
# dom-input-colorspace

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
colorSpace
Chrome – No support
Chrome
footnote
footnote See bug 368059226
Edge – No support
Edge
footnote
footnote See bug 368059226
Firefox – Full support
Firefox 149 (Release date: 2026-03-24)
footnote Full support
Opera – No support
Opera
footnote
footnote See bug 368059226
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 368059226
Firefox for Android – Full support
Firefox for Android 149 (Release date: 2026-03-24)
footnote Full support
Opera Android – No support
Opera Android
footnote
footnote See bug 368059226
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 368059226
WebView Android – No support
WebView Android
footnote
footnote See bug 368059226
WebView on iOS – Full support
WebView on iOS 18.4 (Release date: 2025-03-31)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also