Skip to content

Commit ec28b6b

Browse files
Add srgb-linear color space, fix rec-2020 naming to rec2020
1 parent b7db93c commit ec28b6b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

CanvasColorSpaceProposal.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ IDL:
3535

3636
enum CanvasColorSpaceEnum {
3737
"srgb", // default
38+
"srgb-linear",
3839
"display-p3",
39-
"rec-2020",
40+
"rec2020",
4041
};
4142

4243
enum CanvasStorageFormatEnum {
@@ -50,8 +51,9 @@ enum CanvasStorageFormatEnum {
5051

5152
interface CanvasColorSpace {
5253
const CanvasColorSpaceEnum srgb = "srgb";
54+
const CanvasColorSpaceEnum srgbLinear = "srgb-linear";
5355
const CanvasColorSpaceEnum displayP3 = "display-p3";
54-
const CanvasColorSpaceEnum rec2020 = "rec-2020";
56+
const CanvasColorSpaceEnum rec2020 = "rec2020";
5557
};
5658

5759
interface CanvasStorageFormat {
@@ -234,7 +236,7 @@ The ``getImageData`` method is responsible for converting the data from the canv
234236

235237
#### Selecting the best color space match for the user agent's display device
236238
<pre>
237-
var colorSpace = window.matchMedia("(color-gamut: rec2020)").matches ? "rec-2020" :
239+
var colorSpace = window.matchMedia("(color-gamut: rec2020)").matches ? "rec2020" :
238240
(window.matchMedia("(color-gamut: p3)").matches ? "display-p3" : "srgb");
239241
</pre>
240242

@@ -257,7 +259,9 @@ Authors of games and imaging apps are expected to be enthusiastic adopters.
257259

258260
* Should context creation throw on an unrecognized, non-undefined creation attribute?
259261

260-
* The [Media Query APIs](https://www.w3.org/TR/mediaqueries-4/) use the names "p3" and "rec2020", while the [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#predefined) uses the names "display-p3" and "rec-2020". This divergence could be confusing.
262+
* The [Media Query APIs](https://www.w3.org/TR/mediaqueries-4/) use the names "srgb" and "p3", while the [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#predefined) uses the names "sRGB" and "display-p3". This divergence could be confusing.
263+
264+
* The [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#predefined) specification does not include sRGB-linear.
261265

262266
## Proposal History
263267

0 commit comments

Comments
 (0)