@@ -66579,8 +66579,6 @@ typedef (<span>HTMLOrSVGImageElement</span> or
66579
66579
<span>OffscreenCanvas</span> or
66580
66580
<span>VideoFrame</span>) <dfn typedef>CanvasImageSource</dfn>;
66581
66581
66582
- enum <dfn enum>PredefinedColorSpace</dfn> { "<span data-x="dom-PredefinedColorSpace-srgb">srgb</span>", "<span data-x="dom-PredefinedColorSpace-display-p3">display-p3</span>" };
66583
-
66584
66582
enum <dfn enum>CanvasColorType</dfn> { "<span data-x="dom-CanvasColorType-unorm8">unorm8</span>", "<span data-x="dom-CanvasColorType-float16">float16</span>" };
66585
66583
66586
66584
enum <dfn enum>CanvasFillRule</dfn> { "<span data-x="dom-context-2d-fillRule-nonzero">nonzero</span>", "<span data-x="dom-context-2d-fillRule-evenodd">evenodd</span>" };
@@ -67015,22 +67013,6 @@ context.fillRect(100,0,50,50); // only this square remains</code></pre>
67015
67013
67016
67014
<hr>
67017
67015
67018
- <p>The <code>PredefinedColorSpace</code> enumeration is used to specify the <span
67019
- data-x="concept-canvas-color-space">color space</span> of the canvas's backing store.</p>
67020
-
67021
- <p>The "<dfn enum-value for="PredefinedColorSpace"><code
67022
- data-x="dom-PredefinedColorSpace-srgb">srgb</code></dfn>" value indicates the <span>'srgb'</span>
67023
- color space.</p>
67024
-
67025
- <p>The "<dfn enum-value for="PredefinedColorSpace"><code
67026
- data-x="dom-PredefinedColorSpace-display-p3">display-p3</code></dfn>" value indicates the
67027
- <span>'display-p3'</span> color space.</p>
67028
-
67029
- <p class="note">The algorithm for converting between color spaces can be found in the
67030
- <span>Converting Colors</span> section of <cite>CSS Color</cite>. <ref>CSSCOLOR</ref></p>
67031
-
67032
- <hr>
67033
-
67034
67016
<p>The <code>CanvasColorType</code> enumeration is used to specify the <span
67035
67017
data-x="concept-canvas-color-type">color type</span> of the canvas's backing store.</p>
67036
67018
@@ -70004,8 +69986,11 @@ try {
70004
69986
70005
69987
<p id="interpolation">Once a gradient has been created (see below), stops are placed along it to
70006
69988
define how the colors are distributed along the gradient. <span w-nodev>The color of the
70007
- gradient at each stop is the color specified for that stop. Between each such stop, the colors and
70008
- the alpha component must be linearly interpolated over the RGBA space without premultiplying the
69989
+ gradient at each stop is the color specified for that stop, <span
69990
+ data-x="Converting Colors">converted</span> to the <span
69991
+ data-x="concept-canvas-color-space">context's color space</span>. Between each such stop, the
69992
+ colors and the alpha component must be linearly interpolated in the <span
69993
+ data-x="concept-canvas-color-space">context's color space</span> without premultiplying the
70009
69994
alpha value to find the color to use at that offset. Before the first stop, the color must be the
70010
69995
color of the first stop. After the last stop, the color must be the color of the last stop. When
70011
69996
there are no stops, the gradient is <span>transparent black</span>.</span></p>
@@ -71900,6 +71885,17 @@ console.log(pixels.data[2]);
71900
71885
and line styles must be honored, and the stroke must itself also be subjected to the current
71901
71886
transformation matrix.</p></li>
71902
71887
71888
+ <li>
71889
+ <p>Convert the image <var>A</var> to the <span data-x="concept-canvas-color-space">context's
71890
+ color space</span>.</p>
71891
+
71892
+ <p class="note">There do not exist any inputs to a 2D context for which the color space is
71893
+ undefined. The color space for CSS colors is defined in <cite>CSS Color</cite>. The color space
71894
+ for images that specify no color profile information is <span>'srgb'</span>, as
71895
+ specified in the <a href="https://drafts.csswg.org/css-color/#untagged">Color Spaces of Untagged
71896
+ Colors</a> section of <cite>CSS Color</cite>. <ref>CSSCOLOR</ref></p>
71897
+ </li>
71898
+
71903
71899
<li><p>Multiply the alpha component of every pixel in <var>A</var> by <code
71904
71900
data-x="concept-canvas-global-alpha">global alpha</code>.</p></li>
71905
71901
@@ -72940,28 +72936,27 @@ interface <dfn interface>OffscreenCanvasRenderingContext2D</dfn> {
72940
72936
<!--en-GB--><h5 id="colour-spaces-and-colour-correction">Color spaces and color space
72941
72937
conversion</h5>
72942
72938
72943
- <p>The <code>canvas</code> APIs provide mechanisms for specifying the color space of the canvas's
72944
- backing store. The default backing store color space for all canvas APIs is
72945
- <span>'srgb'</span>.</p>
72939
+ <pre><code class="idl">enum <dfn enum>PredefinedColorSpace</dfn> { "<span data-x="dom-PredefinedColorSpace-srgb">srgb</span>", "<span data-x="dom-PredefinedColorSpace-display-p3">display-p3</span>" };</code></pre>
72940
+
72941
+ <p>The <code>PredefinedColorSpace</code> enumeration is used to specify the <span
72942
+ data-x="concept-canvas-color-space">color space</span> of the canvas's backing store.</p>
72943
+
72944
+ <p>The "<dfn enum-value for="PredefinedColorSpace"><code
72945
+ data-x="dom-PredefinedColorSpace-srgb">srgb</code></dfn>" value indicates the <span>'srgb'</span>
72946
+ color space.</p>
72947
+
72948
+ <p>The "<dfn enum-value for="PredefinedColorSpace"><code
72949
+ data-x="dom-PredefinedColorSpace-display-p3">display-p3</code></dfn>" value indicates the
72950
+ <span>'display-p3'</span> color space.</p>
72946
72951
72947
72952
<p><span data-x="Converting Colors">Color space conversion</span> must be applied to the canvas's
72948
- backing store when rendering the canvas to the output device. This color space conversion must be
72953
+ backing store when rendering the canvas to the output device.</p>
72954
+
72955
+ <p class="note">The algorithm for converting between color spaces can be found in the
72956
+ <span>Converting Colors</span> section of <cite>CSS Color</cite>. This color space conversion is
72949
72957
identical to the color space conversion that would be applied to an <code>img</code> element with
72950
72958
a color profile that specifies the same <span data-x="concept-canvas-color-space">color
72951
- space</span> as the canvas's backing store.</p>
72952
-
72953
- <p>When drawing content to a 2D context, all inputs must be <span data-x="Converting
72954
- Colors">converted</span> to the <span data-x="concept-canvas-color-space">context's color
72955
- space</span> before drawing. Interpolation of gradient color stops must be performed on color
72956
- values after conversion to the <span data-x="concept-canvas-color-space">context's color
72957
- space</span>. Alpha blending must be performed on values after conversion to the <span
72958
- data-x="concept-canvas-color-space">context's color space</span>.</p>
72959
-
72960
- <p class="note">There do not exist any inputs to a 2D context for which the color space is
72961
- undefined. The color space for CSS colors is defined in <cite>CSS Color</cite>. The color space
72962
- for images that specify no color profile information is assumed to be <span>'srgb'</span>, as
72963
- specified in the <a href="https://drafts.csswg.org/css-color/#untagged">Color Spaces of Untagged
72964
- Colors</a> section of <cite>CSS Color</cite>. <ref>CSSCOLOR</ref></p>
72959
+ space</span> as the canvas's backing store. <ref>CSSCOLOR</ref></p>
72965
72960
72966
72961
</div>
72967
72962
0 commit comments