Skip to content

Commit

Permalink
Add srgb-linear color space, fix rec-2020 naming to rec2020
Browse files Browse the repository at this point in the history
  • Loading branch information
ccameron-chromium committed Jan 14, 2021
1 parent b7db93c commit ec28b6b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CanvasColorSpaceProposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ IDL:

enum CanvasColorSpaceEnum {
"srgb", // default
"srgb-linear",
"display-p3",
"rec-2020",
"rec2020",
};

enum CanvasStorageFormatEnum {
Expand All @@ -50,8 +51,9 @@ enum CanvasStorageFormatEnum {

interface CanvasColorSpace {
const CanvasColorSpaceEnum srgb = "srgb";
const CanvasColorSpaceEnum srgbLinear = "srgb-linear";
const CanvasColorSpaceEnum displayP3 = "display-p3";
const CanvasColorSpaceEnum rec2020 = "rec-2020";
const CanvasColorSpaceEnum rec2020 = "rec2020";
};

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

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

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

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

* 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.
* 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.

* The [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#predefined) specification does not include sRGB-linear.

## Proposal History

Expand Down

0 comments on commit ec28b6b

Please sign in to comment.