Skip to content

Commit 6b57001

Browse files
[css-color-5] Preserve hsl/hwb identity when result contains none w3c/csswg-drafts@99104cd
1 parent 5a3074d commit 6b57001

1 file changed

Lines changed: 137 additions & 69 deletions

File tree

css-color5-ja.html

Lines changed: 137 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@
490490

491491
§ ~color_t 値の解決-:~CSSCOLOR#resolving-color-values
492492
§ ~color_t 値の直列化-:~CSSCOLOR#serializing-color-values
493+
§ 欠落~成分との補間-:~CSSCOLOR#interpolation-missing
493494

494495
色停:~CSSIMAGE#color-stop
495496
生来な~size:~CSSIMAGE#natural-size
@@ -858,6 +859,7 @@
858859
1 個の~spaceで連結-:singly-space-separated
859860
文字大小比較:case-insensitively:~
860861
hex:16 進
862+
発-:emit:~
861863
862864
尾部を成す:trailing
863865
最初の引数:start of the function
@@ -987,6 +989,8 @@
987989
推定:inferring:~
988990
合格-:pass:~
989991
合格しない:fail
992+
識別情報:identity:~
993+
降格-:degrade:~
990994

991995
単に:merely
992996
他にも:besides
@@ -1067,6 +1071,8 @@
10671071
~~遺物:leftover
10681072
戻る~link:backlink
10691073
勧告候補の期間:CR period
1074+
失われ:lose
1075+
並行する:parallel
10701076

10711077
●未分類
10721078
component::::コンポーネント
@@ -1132,6 +1138,7 @@
11321138
跳ね上が:shot up
11331139
持ち込:bring
11341140
得られ/得る:yield
1141+
結果は:yielding
11351142
総数:total number of
11361143
視覚-化-:visualize
11371144
視覚-化:visualization
@@ -1141,7 +1148,6 @@
11411148
かすかに:barely
11421149
通過-:pass through
11431150
渡-:pass
1144-
得る:yield
11451151
逆向きに:in reverse
11461152
ときにはある:sometimes
11471153
かけ離れる:very far from
@@ -1786,7 +1792,7 @@ <h3 title="Calculating the Result of color-mix">3.3. `color-mix^f の結果の
17861792
• Let item stack be a stack made by reversing items. (Thus, with the first item at the top of the stack.)
17871793
• While item stack has length 2 or greater:
17881794
•• Pop from item stack twice, letting a and b be the two results in order. Let combined percentage be the sum of a and b’s percentages.
1789-
•• Interpolate a and b’s colors as described in CSS Color 4 § 12. Color Interpolation, with a progress percentage equal to (b’s percentage) / combined percentage). If the specified color space is a cylindrical polar color space, then the &lt;hue-interpolation-method&gt; controls the interpolation of hue, as described in CSS Color 4 § 12.4 Hue Interpolation. If no &lt;hue-interpolation-method&gt; is specified, assume shorter.
1795+
•• Interpolate a and b’s colors as described in CSS Color 4 § 13. Color Interpolation, with a progress percentage equal to (b’s percentage) / combined percentage). If the specified color space is a cylindrical polar color space, then the &lt;hue-interpolation-method&gt; controls the interpolation of hue, as described in CSS Color 4 § 13.4 Hue Interpolation. If no &lt;hue-interpolation-method&gt; is specified, assume shorter.
17901796
•• Create a new mix item with the resulting color and a percentage of combined percentage, and push it onto item stack.
17911797
• Set color to the color of the sole remaining item in item stack.
17921798
</li>
@@ -2872,12 +2878,12 @@ <h3 title="Processing Model for Relative Colors ">4.1. 相対~色~用の処理~m
28722878

28732879
<p>
28742880
`欠落~成分$は、
2875-
`~level 4$ の `§ 欠落~成分との補間-法@~CSSCOLOR#interpolation-missing$
2881+
`~level 4$ の `§ 欠落~成分との補間-法$
28762882
と同じ仕方で取扱われる。
28772883
`起点~色$の`欠落~成分$は、
28782884
`相対~色~関数$の色~空間のある成分と`相似的な成分$であるならば,`先へ運ばれ$ることになる。
28792885
2880-
Missing components are handled the same way as with CSS Color 4 § 12.2 Interpolating with Missing Components: the origin colorspace and the relative function colorspace are checked for analogous components which are then carried forward as missing.
2886+
Missing components are handled the same way as with CSS Color 4 § 13.2 Interpolating with Missing Components: the origin colorspace and the relative function colorspace are checked for analogous components which are then carried forward as missing.
28812887
</p>
28822888

28832889
<p>
@@ -6231,7 +6237,7 @@ <h3 title="Color Space for Interpolation">9.1. 補間~用の色~空間</h3>
62316237
にて定義される `color-interpolation-method$t は、
62326238
次のとおり,`~custom色~空間$の利用を許容するよう拡張される:
62336239
6234-
The &lt;color-interpolation-method&gt;, as defined in CSS Color 4 § 12.1 Color Space for Interpolation, is extended to allow use of the custom color spaces:
6240+
The &lt;color-interpolation-method&gt;, as defined in CSS Color 4 § 13.1 Color Space for Interpolation, is extended to allow use of the custom color spaces:
62356241
</p>
62366242

62376243
<pre class="prod">
@@ -6292,7 +6298,7 @@ <h3 title="Resolving color-mix() Values">10.1. `color-mix^f 値の解決-法</h3
62926298
`~level 4$ の `§ ~color_t 値の解決-法$
62936299
]に則って解決した結果になる。
62946300
6295-
If all &lt;color&gt; parameters resolve to the corresponding colors in their respective color spaces, the computed value is the mixed color, in the specified mixing color space, resolved according to CSS Color 4 § 14. Resolving &lt;color&gt; Values.\
6301+
If all &lt;color&gt; parameters resolve to the corresponding colors in their respective color spaces, the computed value is the mixed color, in the specified mixing color space, resolved according to CSS Color 4 § 15. Resolving &lt;color&gt; Values.\
62966302
</li>
62976303
<li>
62986304
他の場合(ある~parameterに `currentcolor$v が利用された場合)
@@ -6303,7 +6309,7 @@ <h3 title="Resolving color-mix() Values">10.1. `color-mix^f 値の解決-法</h3
63036309
関数はそのままなので、
63046310
子~要素の中への継承を保全する。
63056311
6306-
Otherwise (if currentColor was used in the function), the computed value is the color-mix() function with each &lt;color&gt; parameter resolved according to CSS Color 4 § 14. Resolving &lt;color&gt; Values, thus preserving inheritance into child elements.
6312+
Otherwise (if currentColor was used in the function), the computed value is the color-mix() function with each &lt;color&gt; parameter resolved according to CSS Color 4 § 15. Resolving &lt;color&gt; Values, thus preserving inheritance into child elements.
63076313
</li>
63086314
</ul>
63096315

@@ -6325,7 +6331,7 @@ <h3 title="Resolving Relative Color Syntax Values">10.2. 相対~色~構文によ
63256331
関数~名で指示される【!specified RCS】色~空間
63266332
]内の絶対的な `color$t 値に解決した結果になる。
63276333
6328-
If all &lt;color&gt; parameters resolve to the corresponding colors in their respective color spaces, the computed value is the absolute &lt;color&gt; value, in the specified RCS color space, resolved according to CSS Color 4 § 14. Resolving &lt;color&gt; Values.
6334+
If all &lt;color&gt; parameters resolve to the corresponding colors in their respective color spaces, the computed value is the absolute &lt;color&gt; value, in the specified RCS color space, resolved according to CSS Color 4 § 15. Resolving &lt;color&gt; Values.
63296335
</li>
63306336
<li>
63316337
他の場合(ある~parameterに `currentcolor$v が利用された場合)
@@ -6336,7 +6342,7 @@ <h3 title="Resolving Relative Color Syntax Values">10.2. 相対~色~構文によ
63366342
関数はそのままなので、
63376343
子~要素の中への継承を保全する。
63386344
6339-
Otherwise (if currentColor was used in the function), the computed value is the Relative Color Syntax function with the origin &lt;color&gt; parameter resolved according to CSS Color 4 § 14. Resolving &lt;color&gt; Values, thus preserving inheritance into child elements.
6345+
Otherwise (if currentColor was used in the function), the computed value is the Relative Color Syntax function with the origin &lt;color&gt; parameter resolved according to CSS Color 4 § 15. Resolving &lt;color&gt; Values, thus preserving inheritance into child elements.
63406346
</li>
63416347
</ul>
63426348

@@ -6447,7 +6453,7 @@ <h2 title="Serialization">11. 直列化</h2>
64476453
`相対~色~関数$
64486454
]の結果【を成す `color^t 】の直列化を追加する。
64496455
6450-
This section extends CSS Color 4 § 15. Serializing &lt;color&gt; Values to add serialization of the results of the color-mix(), device-cmyk(), and relative color functions.
6456+
This section extends CSS Color 4 § 16. Serializing &lt;color&gt; Values to add serialization of the results of the color-mix(), device-cmyk(), and relative color functions.
64516457
</p>
64526458

64536459
<p>
@@ -6880,7 +6886,7 @@ <h3 title="Serializing color-mix()">11.1. `color-mix^f の直列化-法</h3>
68806886
— 利用される形は、
68816887
引数~内の `in^v に伴って指定された色~空間に依存する:
68826888
6883-
Otherwise, it is a &lt;color&gt;, as defined in CSS Color 4 § 15. Serializing &lt;color&gt; Values.\
6889+
Otherwise, it is a &lt;color&gt;, as defined in CSS Color 4 § 16. Serializing &lt;color&gt; Values.\
68846890
The form used depends on the color space specified with "in".
68856891
</p>
68866892

@@ -6944,14 +6950,33 @@ <h3 title="Serializing color-mix()">11.1. `color-mix^f の直列化-法</h3>
69446950
• Because xyz is just an alias for xyz-d65
69456951
</p>
69466952
</li>
6953+
<li>
6954+
しかしながら,[
6955+
`hsl$v / `hwb$v
6956+
]`色~空間$内で混合した結果に`欠落~成分$
6957+
(`~level 4$ の `§ 欠落~成分との補間-法$
6958+
により`先へ運ばれ$た欠落な~alphaも含む)
6959+
が在る場合、
6960+
元の色~関数と各 `none$v 値を保全するよう,
6961+
`~level 4$ の `§ ~sRGB値の~CSS直列化@~CSSCOLOR#css-serialization-of-srgb$
6962+
に従って[
6963+
`hsl(h s l / a)^v / `hwb(h w b / a)^v
6964+
]の形をとる`現代の色~構文$が利用される
6965+
— `color(srgb r g b)^v の形へ降格することなく
6966+
(そうすると[
6967+
`hsl^v / `hwb^v
6968+
]か否かの識別情報が失われる)。
6969+
6970+
However, if the result of mixing in the hsl or hwb color space has at least one missing color component (including a missing alpha carried forward per CSS Color 4 § 13.2 Interpolating with Missing Components), the form used is the modern hsl(h s l / a) or hwb(h w b / a) syntax respectively, preserving the original color function and each none value per CSS Color 4 § 16.2.2 CSS serialization of sRGB values, rather than degrading to color(srgb r g b) (which would lose the hsl/hwb identity).
6971+
</li>
69476972
</ul>
69486973

69496974
<p>
69506975
往復するための`最小^emな精度は、[
69516976
`~level 4$ の `§ ~color_t 値の直列化-法$
69526977
]にて指定されたそれと同じとする。
69536978
6954-
The minimum precision for round-tripping is the same as that specified in CSS Color 4 § 15. Serializing &lt;color&gt; Values.
6979+
The minimum precision for round-tripping is the same as that specified in CSS Color 4 § 16. Serializing &lt;color&gt; Values.
69556980
</p>
69566981

69576982
<div class="example" id="ex-serial-computed-color-mix">
@@ -7315,77 +7340,101 @@ <h3 title="Serializing Relative Color Functions">11.3. 相対~色~関数の直
73157340
is the string "oklch(from peru l c h)"
73167341
</div>
73177342

7318-
73197343
<div class="example" id="ex-serial-rcs-calc">
73207344
<p>
7321-
例えば,
7345+
例えば,宣言d値
73227346
`rgb(from red calc(r / 2) g calc(30%))^v
7323-
を直列化した結果は:
7324-
</p>
7325-
<ul>
7326-
<li>
7327-
宣言d値である場合
7328-
7329-
`rgb(from red calc(0.5 * r) g calc(30%))^l,
7330-
</li>
7331-
<li>
7332-
算出d値である場合
7347+
を直列化した結果は
73337348
7334-
`color(srgb 0.5 0 0.3)^l
7335-
</li>
7336-
</ul>
7349+
`rgb(from red calc(0.5 * r) g calc(30%))^l
73377350
73387351
For example, the serialization of the declared value of
73397352
• rgb(from red calc(r / 2) g calc(30%));
7340-
is the string "rgb(from red calc(0.5 * r) g calc(30%))", while the serialization of the computed value is the string "color(srgb 0.5 0 0.3)".
7353+
is the string "rgb(from red calc(0.5 * r) g calc(30%))",\
7354+
</p>
7355+
7356+
<p>
7357+
一方で,その算出d値を直列化した結果は
7358+
7359+
`color(srgb 0.5 0 0.3)^l
7360+
7361+
while the serialization of the computed value is the string "color(srgb 0.5 0 0.3)".
7362+
</p>
73417363
</div>
73427364

73437365
<div class="example" id="ex-serial-rcs-nested-none">
73447366
<p>
7345-
例えば,
7367+
例えば,宣言d値
73467368
`hsl(from hsl(none 10% 50%) h s l)^v
7347-
を直列化した結果は:
7348-
</p>
7349-
<ul>
7350-
<li>
7351-
宣言d値である場合
7369+
を直列化した結果は
73527370
7353-
`hsl(from hsl(none 10% 50%) h s l)^l,
7354-
</li>
7355-
<li>
7356-
算出d値である場合
7371+
`hsl(from hsl(none 10% 50%) h s l)^l
7372+
7373+
For example, the serialization of the declared value of
7374+
• hsl(from hsl(none 10% 50%) h s l);
7375+
is the string "hsl(from hsl(none 10% 50%) h s l)",\
7376+
</p>
7377+
7378+
<p>
7379+
一方で,その算出d値を直列化した結果は
73577380
73587381
`color(srgb 0.55 0.45 0.45)^l
7359-
</li>
7360-
</ul>
7382+
7383+
while the serialization of the computed value is the string "color(srgb 0.55 0.45 0.45)".
7384+
</p>
7385+
</div>
7386+
7387+
<div class="example" id="ex-serial-rcs-alpha-none">
7388+
<p>
7389+
例えば,宣言d値
7390+
`hsl(from rebeccapurple none none none / none)^v
7391+
を直列化した結果は
7392+
7393+
`hsl(from rebeccapurple none none none / none)^l
73617394
73627395
For example, the serialization of the declared value of
7363-
• hsl(from hsl(none 10% 50%) h s l);
7364-
is the string "hsl(from hsl(none 10% 50%) h s l)", while the serialization of the computed value is the string "color(srgb 0.55 0.45 0.45)".
7396+
7397+
hsl(from rebeccapurple none none none / none);
7398+
7399+
is the string "hsl(from rebeccapurple none none none / none)".
7400+
</p>
7401+
7402+
<p>
7403+
`算出d値$は,`先へ運ばれ$た欠落な~alphaがあるので
7404+
(~alphaに`相似的な成分$は~alphaである)、
7405+
その[
7406+
色相, 彩度, 明度, ~alpha
7407+
]すべてが`欠落~成分$である`相対~色$ `hsl$f を与える。
7408+
`解決d値$は`欠落~成分$を包含するので、
7409+
その直列化は `hsl$f 用の`現代の色~構文$を利用する
7410+
— 結果は、
7411+
`color(srgb 0 0 0 / none)^l ではなく,
7412+
`hsl(none none none / none)^l になる。
7413+
7414+
The computed value carries forward the missing alpha (alpha is its own analogous component), giving an hsl() relative color whose hue, saturation, lightness, and alpha are all missing. Because the resolved value contains missing color components, the serialization uses the modern hsl() form, yielding the string "hsl(none none none / none)" rather than color(srgb 0 0 0 / none).
7415+
</p>
73657416
</div>
73667417

73677418
<div class="example" id="ex-serial-rcs-hsl-unclamped">
73687419
<p>
7369-
例えば,
7420+
例えば,宣言d値
73707421
`hsl(from hsl(127.9 302% 25.33%) h s l)^v
7371-
を直列化した結果は:
7372-
</p>
7373-
<ul>
7374-
<li>
7375-
宣言d値である場合
7422+
を直列化した結果は
73767423
73777424
`hsl(from hsl(127.9 302% 25.33%) h s l)^l
7378-
</li>
7379-
<li>
7380-
算出d値である場合
7381-
7382-
`color(srgb -0.511666 1.018266 -0.310225)^l
7383-
</li>
7384-
</ul>
73857425
73867426
For example, the serialization of the declared value of
73877427
• hsl(from hsl(127.9 302% 25.33%) h s l);
7388-
is the string "hsl(from hsl(127.9 302% 25.33%) h s l)", while the serialization of the computed value is the string "color(srgb -0.511666 1.018266 -0.310225)".
7428+
is the string "hsl(from hsl(127.9 302% 25.33%) h s l)",\
7429+
</p>
7430+
7431+
<p>
7432+
一方で,その算出d値を直列化した結果は
7433+
7434+
`color(srgb -0.511666 1.018266 -0.310225)^l
7435+
7436+
while the serialization of the computed value is the string "color(srgb -0.511666 1.018266 -0.310225)".
7437+
</p>
73897438
</div>
73907439

73917440
<div class="example" id="ex-serial-rcs-currentcolor">
@@ -7404,25 +7453,20 @@ <h3 title="Serializing Relative Color Functions">11.3. 相対~色~関数の直
74047453
</pre>
74057454

74067455
<p>
7407-
`background-color^p の値を直列化した結果は:
7408-
7409-
</p>
7410-
<ul>
7411-
<li>
7412-
宣言d値である場合
7456+
`background-color^p の宣言d値を直列化した結果は:
74137457
74147458
`rgb(from currentcolor r g calc(b / 2))^l
74157459
74167460
The serialization of the declared value of background-color is the string "rgb(from currentcolor r g calc(b / 2))"\
7417-
</li>
7418-
<li>
7419-
算出d値である場合
7461+
</p>
7462+
7463+
<p>
7464+
一方で,その算出d値を直列化した結果は
74207465
74217466
`color(srgb 0 0 0.5)^l
74227467
74237468
while the serialization of the computed value is the string "color(srgb 0 0 0.5)"
7424-
</li>
7425-
</ul>
7469+
</p>
74267470
</div>
74277471

74287472
<p>
@@ -7449,7 +7493,7 @@ <h3 title="Serializing Relative Color Functions">11.3. 相対~色~関数の直
74497493
— 利用される形は、
74507494
`相対~色$の色~空間に依存する:
74517495
7452-
Otherwise, it is the resolved value, which is a &lt;color&gt;, as defined in CSS Color 4 § 15. Serializing &lt;color&gt; Values.
7496+
Otherwise, it is the resolved value, which is a &lt;color&gt;, as defined in CSS Color 4 § 16. Serializing &lt;color&gt; Values.
74537497
74547498
The form used depends on the color space of the relative color:
74557499
</p>
@@ -7505,6 +7549,30 @@ <h3 title="Serializing Relative Color Functions">11.3. 相対~色~関数の直
75057549
<td>`oklch(l c h)^v
75067550
</table>
75077551
</li>
7552+
<li>
7553+
しかしながら,`相対~色$を成す[
7554+
`hsl$f / `hwb$f
7555+
]の`解決d値$に`欠落~成分$
7556+
(`~level 4$ の `§ 欠落~成分との補間-法$
7557+
により`起点~色$から`先へ運ばれ$た欠落な~alphaも含む)
7558+
が在る場合、
7559+
元の色~関数と各 `none$v 値を保全するよう,[
7560+
`hsl(h s l / a)^v / `hwb(h w b / a)^v
7561+
]の形をとる`現代の色~構文$が利用される
7562+
— `color(srgb r g b)^v の形へ降格することなく
7563+
(そうすると[
7564+
`hsl$v / `hwb$v
7565+
]か否かの識別情報が失われる)。
7566+
これは、
7567+
`§ 起点~色の直列化-法@#serial-origin-color$
7568+
に並行する
7569+
— それは、
7570+
`起点~色$用には,常に現代の~slash構文を発することに加え,
7571+
`~level 4$ の `§ ~sRGB値の~CSS直列化@~CSSCOLOR#css-serialization-of-srgb$
7572+
による一般な~sRGB直列化~規則に従う。
7573+
7574+
However, if the resolved value of an hsl() or hwb() relative color has at least one missing color component (including a missing alpha carried forward from the origin color per CSS Color 4 § 13.2 Interpolating with Missing Components), the form used is the modern hsl(h s l / a) or hwb(h w b / a) syntax respectively, preserving the original color function and each none value, rather than degrading to color(srgb r g b) (which would lose the hsl/hwb identity). This parallels § 11.2 Serializing Origin Colors, which always emits the modern slash syntax for origin colors, and follows the general sRGB serialization rules in CSS Color 4 § 16.2.2 CSS serialization of sRGB values.
7575+
</li>
75087576
</ul>
75097577

75107578
<p>
@@ -7513,7 +7581,7 @@ <h3 title="Serializing Relative Color Functions">11.3. 相対~色~関数の直
75137581
<a href="~CSSCOLOR#serializing-color-function-values">§ `color^f 関数の直列化-法</a>
75147582
]にて指定されたそれと同じとする。
75157583
7516-
The minimum precision for round-tripping is the same as that specified in CSS Color 4 § 15.5 Serializing values of the color() function.
7584+
The minimum precision for round-tripping is the same as that specified in CSS Color 4 § 16.5 Serializing values of the color() function.
75177585
</p>
75187586

75197587
<div class="example" id="ex-serial-rcs-computed">

0 commit comments

Comments
 (0)