Skip to content

Commit 38b05ab

Browse files
[HTML] Editorial: clean up color conversion presentation in canvas whatwg/html@a4809f6
1 parent 90ed01c commit 38b05ab

File tree

1 file changed

+56
-76
lines changed

1 file changed

+56
-76
lines changed

HTML-canvas-ja.html

Lines changed: 56 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@
177177

178178
●●options
179179

180-
spec_date:2025-06-27
181-
trans_update:2025-05-24
180+
spec_date:2025-09-17
181+
trans_update:2025-09-18
182182
source_checked:240712
183183
page_state_key:HTML
184184
spec_status:LS
@@ -1354,7 +1354,6 @@
13541354
分布-:distribute::~
13551355
JPEG:
13561356
PNG:
1357-
RGBA:
13581357
遮る:obscureする:~
13591358
光度:intensity::~
13601359
裏画像:backing store::~
@@ -2968,8 +2967,6 @@ <h5 title="The 2D rendering context">4.12.5.1. ~2D描画~文脈</h5>
29682967
`OffscreenCanvas$I or
29692968
`VideoFrame$I) `CanvasImageSource@I;
29702969

2971-
enum `PredefinedColorSpace@I { `srgb$l, `display-p3$l };
2972-
29732970
enum `CanvasColorType@I { `unorm8$l, `float16$l };
29742971

29752972
enum `CanvasFillRule@I { `nonzero$l, `evenodd$l };
@@ -3759,38 +3756,6 @@ <h5 title="The 2D rendering context">4.12.5.1. ~2D描画~文脈</h5>
37593756

37603757
<hr>
37613758

3762-
<p>
3763-
`PredefinedColorSpace$I 列挙~型の値は、
3764-
~canvasの裏画像( `backing store^en )用の色~空間を指定する:
3765-
3766-
The PredefinedColorSpace enumeration is used to specify the color space of the canvas's backing store.
3767-
</p>
3768-
<dl class="def-list">
3769-
<dt>`srgb@l</dt>
3770-
<dd>
3771-
`srgb$v 色~空間を指示する。
3772-
3773-
The "srgb" value indicates the 'srgb' color space.
3774-
</dd>
3775-
3776-
<dt>`display-p3@l</dt>
3777-
<dd>
3778-
`display-p3$v 色~空間を指示する。
3779-
3780-
The "display-p3" value indicates the 'display-p3' color space.
3781-
</dd>
3782-
</dl>
3783-
3784-
<p class="note">注記:
3785-
互いの色~空間へ変換する~algoは、
3786-
`CSSCOLOR$r `§ 色の変換-法@~CSSCOLOR#color-conversion$
3787-
にて見出せる。
3788-
3789-
The algorithm for converting between color spaces can be found in the Converting Colors section of CSS Color. [CSSCOLOR]
3790-
</p>
3791-
3792-
<hr>
3793-
37943759
<p>
37953760
`CanvasColorType$I 列挙~型の値は、
37963761
~canvasの裏画像~用の色~型を指定する:
@@ -9001,12 +8966,12 @@ <h6 title="Fill and stroke styles">4.12.5.1.10. ~fill~style, ~stroke~style</h6>
90018966
<ul>
90028967
<li>
90038968
各 色停の所での色は、
9004-
その色停が指定する色になる
8969+
その色停が指定する色を当の文脈の`色~空間$2Dへ`変換した@~CSSCOLOR#color-conversion$結果になる
90058970
</li>
90068971
<li>
90078972
2 つの色停の合間における色は、[
90088973
色, ~alpha
9009-
成分を~RGBA空間~内で線型に補間して得る
8974+
成分を当の文脈の`色~空間$2D内で線型に補間した結果になる
90108975
— 色~成分に対しては~alpha値で乗算することなく。
90118976
</li>
90128977
<li>
@@ -9023,7 +8988,7 @@ <h6 title="Fill and stroke styles">4.12.5.1.10. ~fill~style, ~stroke~style</h6>
90238988
</li>
90248989
</ul>
90258990
9026-
Once a gradient has been created (see below), stops are placed along it to define how the colors are distributed along the gradient. The color of the gradient at each stop is the color specified for that stop. Between each such stop, the colors and the alpha component must be linearly interpolated over the RGBA space without premultiplying the alpha value to find the color to use at that offset. Before the first stop, the color must be the color of the first stop. After the last stop, the color must be the color of the last stop. When there are no stops, the gradient is transparent black.
8991+
Once a gradient has been created (see below), stops are placed along it to define how the colors are distributed along the gradient. The color of the gradient at each stop is the color specified for that stop, converted to the context's color space. Between each such stop, the colors and the alpha component must be linearly interpolated in the context's color space without premultiplying the alpha value to find the color to use at that offset. Before the first stop, the color must be the color of the first stop. After the last stop, the color must be the color of the last stop. When there are no stops, the gradient is transparent black.
90278992
</div>
90288993

90298994
<dl class="domintro">
@@ -12592,6 +12557,26 @@ <h6 title="Drawing model">4.12.5.1.22. 描法~model</h6>
1259212557
Render the shape or image onto an infinite transparent black bitmap, creating image A, as described in the previous sections. For shapes, the current fill, stroke, and line styles must be honored, and the stroke must itself also be subjected to the current transformation matrix.
1259312558
</li>
1259412559
<li>
12560+
<p>
12561+
%A を当の文脈の`色~空間$2Dへ変換する
12562+
12563+
Convert the image A to the context's color space.
12564+
</p>
12565+
12566+
<p class="note">注記:
12567+
~2D文脈に対する入力において色~空間が未定義になるものは、
12568+
存在しない。
12569+
~CSS色~用の色~空間は、
12570+
`CSSCOLOR$r にて定義される。
12571+
色~profile情報を指定しない画像~用の色~空間は、
12572+
`CSSCOLOR$r `§ ~tag無しな色が成す色~空間@~CSSCOLOR#untagged$
12573+
にて指定されるとおり,
12574+
`srgb$v になる。
12575+
12576+
There do not exist any inputs to a 2D context for which the color space is undefined. The color space for CSS colors is defined in CSS Color. The color space for images that specify no color profile information is 'srgb', as specified in the Color Spaces of Untagged Colors section of CSS Color. [CSSCOLOR]
12577+
</p>
12578+
</li>
12579+
<li>
1259512580
%A 内の各~画素に対し,その~alpha成分を`大域~alpha$2Dで乗算する
1259612581
1259712582
Multiply the alpha component of every pixel in A by global alpha.
@@ -14197,54 +14182,49 @@ <h6 title="The offscreen 2D rendering context">4.12.5.3.1. ~offscreen~2D描画~
1419714182
<section id="colour-spaces-and-colour-correction">
1419814183
<h5 title="Color spaces and color space conversion">4.12.5.4. 色~空間とその変換</h5>
1419914184

14185+
<pre class="idl">
14186+
enum `PredefinedColorSpace@I { `srgb$l, `display-p3$l };
14187+
</pre>
14188+
1420014189
<p>
14201-
`canvas$e ~APIは、
14202-
~canvasの裏画像
14203-
( `backing store^en, 裏で格納される画像~data)用の色~空間を指定するための仕組みを供する。
14204-
すべての~canvas~API用の,裏画像~用の既定の色~空間は、
14205-
`srgb$v とする。
14190+
`PredefinedColorSpace$I 列挙~型の値は、
14191+
~canvasの裏画像( `backing store^en, 裏で格納される画像~data)用の色~空間を指定する:
1420614192
14207-
The canvas APIs provide mechanisms for specifying the color space of the canvas's backing store. The default backing store color space for all canvas APIs is 'srgb'.
14193+
The PredefinedColorSpace enumeration is used to specify the color space of the canvas's backing store.
1420814194
</p>
14195+
<dl class="def-list">
14196+
<dt>`srgb@l</dt>
14197+
<dd>
14198+
`srgb$v 色~空間を指示する。
14199+
14200+
The "srgb" value indicates the 'srgb' color space.
14201+
</dd>
1420914202

14210-
<p>
14211-
~canvasを出力~機器に描画するときは、
14212-
~canvasの裏画像に対し`色~空間の変換@~CSSCOLOR#color-conversion$を適用してから行うモノトスル。
14213-
この変換は、
14214-
次に一致するモノトスル
14215-
14216-
`img$e 要素【の~source画像】が[
14217-
~canvasの裏画像と同じ`色~空間$2Dを指定する色~profile
14218-
]を伴う場合に適用される色~空間の変換
14203+
<dt>`display-p3@l</dt>
14204+
<dd>
14205+
`display-p3$v 色~空間を指示する。
1421914206
14220-
Color space conversion must be applied to the canvas's backing store when rendering the canvas to the output device. This color space conversion must be identical to the color space conversion that would be applied to an img element with a color profile that specifies the same color space as the canvas's backing store.
14221-
</p>
14207+
The "display-p3" value indicates the 'display-p3' color space.
14208+
</dd>
14209+
</dl>
1422214210

1422314211
<p>
14224-
内容を~2D文脈に描くときは、
14225-
その前に,[
14226-
すべての入力を当の~2D文脈の`色~空間$2Dへ`変換する@~CSSCOLOR#color-conversion$
14227-
]モノトスル。
14228-
14229-
~gradient色停の補間/~alpha混色
14230-
]は、[
14231-
当の`色~空間$2Dへ変換した後の色~値
14232-
]に対し遂行するモノトスル。
14212+
~canvasを出力~機器に描画するときは、
14213+
~canvasの裏画像に対し`色~空間の変換@~CSSCOLOR#color-conversion$を適用してから行うモノトスル。
1423314214
14234-
When drawing content to a 2D context, all inputs must be converted to the context's color space before drawing. Interpolation of gradient color stops must be performed on color values after conversion to the context's color space. Alpha blending must be performed on values after conversion to the context's color space.
14215+
Color space conversion must be applied to the canvas's backing store when rendering the canvas to the output device.
1423514216
</p>
1423614217

1423714218
<p class="note">注記:
14238-
~2D文脈に対する入力において色~空間が未定義になるものは、
14239-
存在しない。
14240-
~CSS色~用の色~空間は、
14241-
`CSSCOLOR$r にて定義される。
14242-
色~profile情報を指定しない画像~用の色~空間は、
14243-
`CSSCOLOR$r `§ ~tag無しな色が成す色~空間@~CSSCOLOR#untagged$
14244-
に指定されるとおり,
14245-
`srgb$v と見做される。
14219+
互いの色~空間へ変換する~algoは、
14220+
`CSSCOLOR$r `§ 色の変換-法@~CSSCOLOR#color-conversion$
14221+
にて見出せる。
14222+
この変換は、
14223+
`img$e 要素【の~source画像】が[
14224+
~canvasの裏画像と同じ`色~空間$2Dを指定する色~profile
14225+
]を伴う場合に適用される色~空間の変換に一致する。
1424614226
14247-
There do not exist any inputs to a 2D context for which the color space is undefined. The color space for CSS colors is defined in CSS Color. The color space for images that specify no color profile information is assumed to be 'srgb', as specified in the Color Spaces of Untagged Colors section of CSS Color. [CSSCOLOR]
14227+
The algorithm for converting between color spaces can be found in the Converting Colors section of CSS Color. This color space conversion is identical to the color space conversion that would be applied to an img element with a color profile that specifies the same color space as the canvas's backing store. [CSSCOLOR]
1424814228
</p>
1424914229

1425014230
</section>

0 commit comments

Comments
 (0)