Skip to content

Commit 1d3c348

Browse files
committed
[css-color-4] Fix #4056 hyphens in colorspaces
1 parent 4d7627c commit 1d3c348

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

css-color-4/Overview.bs

+30-30
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ Profiled, Device-dependent Colors</h2>
20152015
''color()'' represents <a>opaque black</a>.
20162016

20172017
<h3 id="predefined">
2018-
Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' and ''rec2020''.</h3>
2018+
Predefined colorspaces: ''srgb'', ''display-p3'', ''a98-rgb'', ''prophoto-rgb'' and ''rec-2020''.</h3>
20192019

20202020
The following colorspaces are predefined for use in the ''color()'' function.
20212021
They can be used without any ''@color-profile'' rule.
@@ -2080,21 +2080,21 @@ Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' an
20802080
<tr><th>Black luminance</th><td colspan="2">0.80 cd/m<sup>2</sup></td></tr>
20812081
</table>
20822082

2083-
<dt><dfn>a98rgb</dfn>
2083+
<dt><dfn>a98-rgb</dfn>
20842084
<dd>
2085-
The ''a98rgb'' colorspace accepts three numeric parameters,
2085+
The ''a98-rgb'' colorspace accepts three numeric parameters,
20862086
representing the red, green, and blue channels of the color,
20872087
with each having a valid range of [0, 1]. The transfer curve is
20882088
a gamma function, close to but not exactly 1/2.2.
20892089

2090-
''a98rgb'' is compatible with Adobe® RGB (1998) [[!AdobeRGB]].
2090+
''a98-rgb'' is compatible with Adobe® RGB (1998) [[!AdobeRGB]].
20912091

20922092
Adobe® RGB (1998) uses primaries originally derived
20932093
from the SMPTE 240M standard;
20942094
errors in the original conversion turned out
20952095
to produce a colorspace that was useful for digital photography,
20962096
so Adobe® RGB (1998) is a common wider-gamut colorspace for
2097-
photographic images. The ''a98rgb'' colorspace allows CSS to
2097+
photographic images. The ''a98-rgb'' colorspace allows CSS to
20982098
specify colors that will match colors in such images
20992099
having the same RGB values.
21002100

@@ -2111,9 +2111,9 @@ Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' an
21112111
<tr><th>Black luminance</th><td colspan="2">0.5557 cd/m<sup>2</sup></td></tr>
21122112
</table>
21132113

2114-
<dt><dfn>prophotorgb</dfn>
2114+
<dt><dfn>prophoto-rgb</dfn>
21152115
<dd>
2116-
The ''prophotorgb'' colorspace accepts three numeric parameters,
2116+
The ''prophoto-rgb'' colorspace accepts three numeric parameters,
21172117
representing the red, green, and blue channels of the color,
21182118
with each having a valid range of [0, 1]. The transfer curve is
21192119
a gamma function with a value of 1/1.8.
@@ -2124,7 +2124,7 @@ Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' an
21242124
a wide color gamut and to minimise hue shifts under tonal manipulation.
21252125
It is often used in digital photography as a wide gamut
21262126
colorspace for the master version of
2127-
photographic images. The ''prophotorgb'' colorspace allows CSS to
2127+
photographic images. The ''prophoto-rgb'' colorspace allows CSS to
21282128
specify colors that will match colors in such images
21292129
having the same RGB values.
21302130

@@ -2145,9 +2145,9 @@ Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' an
21452145
<tr><th>Black luminance</th><td colspan="2">See text</td></tr>
21462146
</table>
21472147

2148-
<dt><dfn>rec2020</dfn>
2148+
<dt><dfn>rec-2020</dfn>
21492149
<dd>
2150-
The ''rec2020'' [[!Rec.2020]] colorspace accepts three numeric parameters,
2150+
The ''rec-2020'' [[!Rec.2020]] colorspace accepts three numeric parameters,
21512151
representing the red, green, and blue channels of the color,
21522152
with each having a valid range of [0, 1]. ITU Reference 2020 is used for High Definition, 4k and 8k television.
21532153

@@ -2162,7 +2162,7 @@ Predefined colorspaces: ''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'' an
21622162
<tr><th>Transfer function</th><td colspan="2">1/2.4 (see note)</td></tr>
21632163
</table>
21642164

2165-
Note: Rec2020 references a different transfer curve for cameras. However
2165+
Note: rec-2020 references a different transfer curve for cameras. However
21662166
this curve is never used in production cameras or 2020 displays.<br/>
21672167
"In typical production practice the encoding function of image sources is adjusted so that the final picture has the desired look, as viewed on a reference monitor having the reference decoding function of Recommendation ITU-R BT.1886, in the reference viewing environment defined in Recommendation ITU-R BT.2035."<br/>
21682168
The transfer function (1886) for reference Rec.2020 displays is gamma 2.4 [[!Rec.2020]]
@@ -2180,7 +2180,7 @@ Converting predefined colorspaces to Lab</h4>
21802180
<ol>
21812181
<li>Convert from gamma-corrected RGB to linear-light RGB (undo gamma encoding)
21822182
<li>Convert from linear RGB to CIE XYZ
2183-
<li>Convert from a D65 whitepoint (used by both display-p3 and rec2020) to the D50 whitepoint used in Lab,
2183+
<li>Convert from a D65 whitepoint (used by both display-p3 and rec-2020) to the D50 whitepoint used in Lab,
21842184
with the Bradford transform
21852185
<li>Convert D50-adapted XYZ to Lab
21862186
</ol>
@@ -2189,7 +2189,7 @@ Converting predefined colorspaces to Lab</h4>
21892189
<h4 id="lab-to-predefined">
21902190
Converting Lab to predefined colorspaces</h4>
21912191

2192-
Conversion from Lab to display-p3 or rec2020 also requires multiple steps,
2192+
Conversion from Lab to display-p3 or rec-2020 also requires multiple steps,
21932193
and again in practice all but the last step are linear calculations and can be combined.
21942194

21952195
<ol>
@@ -2218,7 +2218,7 @@ Specifying a color profile: the ''@color-profile'' at-rule</h3>
22182218

22192219
The <<custom-ident>> gives the <a>color profile's</a> name.
22202220
All of the predefined colorspace keywords
2221-
(''srgb'', ''display-p3'', ''a98rgb'', ''prophotorgb'', ''rec2020'')
2221+
(''srgb'', ''display-p3'', ''a98-rgb'', ''prophoto-rgb'', ''rec-2020'')
22222222
are excluded from this <<custom-ident>>,
22232223
as they're predefined by this specification and always available.
22242224

@@ -2621,10 +2621,10 @@ Default Style Rules</h2>
26212621
return math.multiply(M, XYZ).valueOf();
26222622
}
26232623

2624-
// ProPhotoRGB functions
2624+
// prophoto-rgb functions
26252625

26262626
function lin_ProPhoto(RGB) {
2627-
// convert an array of ProPhotoRGB values in the range 0.0 - 1.0
2627+
// convert an array of prophoto-rgb values in the range 0.0 - 1.0
26282628
// to linear light (un-companded) form.
26292629
// Transfer curve is gamma 1.0 with a small linear portion
26302630
return RGB.map(function (val) {
@@ -2637,7 +2637,7 @@ Default Style Rules</h2>
26372637
}
26382638

26392639
function gam_ProPhoto(RGB) {
2640-
// convert an array of linear-light ProPhotoRGB in the range 0.0-1.0
2640+
// convert an array of linear-light prophoto-rgb in the range 0.0-1.0
26412641
// to gamma corrected form
26422642
// Transfer curve is gamma 1.0 with a small linear portion
26432643
return RGB.map(function (val) {
@@ -2650,7 +2650,7 @@ Default Style Rules</h2>
26502650
}
26512651

26522652
function lin_ProPhoto_to_XYZ(rgb) {
2653-
// convert an array of linear-light ProPhotoRGB values to CIE XYZ
2653+
// convert an array of linear-light prophoto-rgb values to CIE XYZ
26542654
// using D50 (so no chromatic adaptation needed afterwards)
26552655
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
26562656
var M = Math.matrix([
@@ -2663,7 +2663,7 @@ Default Style Rules</h2>
26632663
}
26642664

26652665
function XYZ_to_lin_ProPhoto(XYZ) {
2666-
// convert XYZ to linear-light ProPhotoRGB
2666+
// convert XYZ to linear-light prophoto-rgb
26672667
var M = Math.matrix([
26682668
[ 1.3457989731028281, -0.25558010007997534, -0.05110628506753401 ],
26692669
[ -0.5446224939028347, 1.5082327413132781, 0.02053603239147973 ],
@@ -2673,26 +2673,26 @@ Default Style Rules</h2>
26732673
return Math.multiply(M, XYZ).valueOf();
26742674
}
26752675

2676-
// a98rgb functions
2676+
// a98-rgb functions
26772677

2678-
function lin_a98rgb(RGB) {
2679-
// convert an array of a98rgb values in the range 0.0 - 1.0
2678+
function lin_a98-rgb(RGB) {
2679+
// convert an array of a98-rgb values in the range 0.0 - 1.0
26802680
// to linear light (un-companded) form.
26812681
return RGB.map(function (val) {
26822682
return Math.pow(val, 563/256);
26832683
});
26842684
}
26852685

2686-
function gam_a98rgb(RGB) {
2687-
// convert an array of linear-light a98rgb in the range 0.0-1.0
2686+
function gam_a98-rgb(RGB) {
2687+
// convert an array of linear-light a98-rgb in the range 0.0-1.0
26882688
// to gamma corrected form
26892689
return RGB.map(function (val) {
26902690
return Math.pow(val, 256/563);
26912691
});
26922692
}
26932693

2694-
function lin_a98rgb_to_XYZ(rgb) {
2695-
// convert an array of linear-light ProPhotoRGB values to CIE XYZ
2694+
function lin_a98-rgb_to_XYZ(rgb) {
2695+
// convert an array of linear-light prophoto-rgb values to CIE XYZ
26962696
// using D50 (so no chromatic adaptation needed afterwards)
26972697
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
26982698
var M = Math.matrix([
@@ -2704,8 +2704,8 @@ Default Style Rules</h2>
27042704
return Math.multiply(M, rgb).valueOf();
27052705
}
27062706

2707-
function XYZ_to_lin_a98rgb(XYZ) {
2708-
// convert XYZ to linear-light ProPhotoRGB
2707+
function XYZ_to_lin_a98-rgb(XYZ) {
2708+
// convert XYZ to linear-light prophoto-rgb
27092709
var M = Math.matrix([
27102710
[ 2.0415879038107465, -0.5650069742788596, -0.34473135077832956 ],
27112711
[ -0.9692436362808795, 1.8759675015077202, 0.04155505740717557 ],
@@ -2994,10 +2994,10 @@ Changes</h2>
29942994
<li>Clarify hue in LCH is modulo 360deg</li>
29952995
<li>Clarify allowed range of L in LCH and Lab, and meaning of L=100</li>
29962996
<li>Update references for colorspaces used in video</li>
2997-
<li>Add ProPhotoRGB predefined colorspace</li>
2997+
<li>Add prophoto-rgb predefined colorspace</li>
29982998
<li>Correct black and white luminance levels for display-p3</li>
29992999
<li>Clarify display-p3 transfer function</li>
3000-
<li>Add a98rgb colorspace</li>
3000+
<li>Add a98-rgb colorspace</li>
30013001
<li>Clarify that currentColor's computed value is not the resolved color</li>
30023002
<li>Update syntax is examples to conform to latest specification</li>
30033003
<li>Remove the color-mod() function</li>

css-color-4/conversions.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ function XYZ_to_lin_P3(XYZ) {
9696
return math.multiply(M, XYZ).valueOf();
9797
}
9898

99-
// ProPhotoRGB functions
99+
// prophoto-rgb functions
100100

101101
function lin_ProPhoto(RGB) {
102-
// convert an array of ProPhotoRGB values in the range 0.0 - 1.0
102+
// convert an array of prophoto-rgb values in the range 0.0 - 1.0
103103
// to linear light (un-companded) form.
104-
// Transfer curve is gamma 1.0 with a small linear portion
104+
// Transfer curve is gamma 1.8 with a small linear portion
105105
return RGB.map(function (val) {
106106
if (val < 0.031248) {
107107
return val / 16;
@@ -112,9 +112,9 @@ function lin_ProPhoto(RGB) {
112112
}
113113

114114
function gam_ProPhoto(RGB) {
115-
// convert an array of linear-light ProPhotoRGB in the range 0.0-1.0
115+
// convert an array of linear-light prophoto-rgb in the range 0.0-1.0
116116
// to gamma corrected form
117-
// Transfer curve is gamma 1.0 with a small linear portion
117+
// Transfer curve is gamma 1.8 with a small linear portion
118118
return RGB.map(function (val) {
119119
if (val > 0.001953) {
120120
return Math.pow(val, 1/1.8);
@@ -125,7 +125,7 @@ function gam_ProPhoto(RGB) {
125125
}
126126

127127
function lin_ProPhoto_to_XYZ(rgb) {
128-
// convert an array of linear-light ProPhotoRGB values to CIE XYZ
128+
// convert an array of linear-light prophoto-rgb values to CIE XYZ
129129
// using D50 (so no chromatic adaptation needed afterwards)
130130
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
131131
var M = Math.matrix([
@@ -138,7 +138,7 @@ function lin_ProPhoto_to_XYZ(rgb) {
138138
}
139139

140140
function XYZ_to_lin_ProPhoto(XYZ) {
141-
// convert XYZ to linear-light ProPhotoRGB
141+
// convert XYZ to linear-light prophoto-rgb
142142
var M = Math.matrix([
143143
[ 1.3457989731028281, -0.25558010007997534, -0.05110628506753401 ],
144144
[ -0.5446224939028347, 1.5082327413132781, 0.02053603239147973 ],
@@ -148,26 +148,26 @@ function XYZ_to_lin_ProPhoto(XYZ) {
148148
return Math.multiply(M, XYZ).valueOf();
149149
}
150150

151-
// a98rgb functions
151+
// a98-rgb functions
152152

153153
function lin_a98rgb(RGB) {
154-
// convert an array of a98rgb values in the range 0.0 - 1.0
154+
// convert an array of a98-rgb values in the range 0.0 - 1.0
155155
// to linear light (un-companded) form.
156156
return RGB.map(function (val) {
157157
return Math.pow(val, 563/256);
158158
});
159159
}
160160

161161
function gam_a98rgb(RGB) {
162-
// convert an array of linear-light a98rgb in the range 0.0-1.0
162+
// convert an array of linear-light a98-rgb in the range 0.0-1.0
163163
// to gamma corrected form
164164
return RGB.map(function (val) {
165165
return Math.pow(val, 256/563);
166166
});
167167
}
168168

169-
function lin_a98rgb_to_XYZ(rgb) {
170-
// convert an array of linear-light a98rgb values to CIE XYZ
169+
function lin_a98-rgb_to_XYZ(rgb) {
170+
// convert an array of linear-light a98-rgb values to CIE XYZ
171171
// using D50 (so no chromatic adaptation needed afterwards)
172172
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
173173
// which has greater numerical precsion than section 4.3.5.3 of
@@ -181,8 +181,8 @@ function lin_a98rgb_to_XYZ(rgb) {
181181
return Math.multiply(M, rgb).valueOf();
182182
}
183183

184-
function XYZ_to_lin_a98rgb(XYZ) {
185-
// convert XYZ to linear-light a98rgb
184+
function XYZ_to_lin_a98-rgb(XYZ) {
185+
// convert XYZ to linear-light a98-rgb
186186
var M = Math.matrix([
187187
[ 2.0415879038107465, -0.5650069742788596, -0.34473135077832956 ],
188188
[ -0.9692436362808795, 1.8759675015077202, 0.04155505740717557 ],
@@ -195,7 +195,7 @@ function XYZ_to_lin_a98rgb(XYZ) {
195195
//Rec. 2020-related functions
196196

197197
function lin_2020(RGB) {
198-
// convert an array of Rec. 2020 RGB values in the range 0.0 - 1.0
198+
// convert an array of rec-2020 RGB values in the range 0.0 - 1.0
199199
// to linear light (un-companded) form.
200200
const α = 1.09929682680944 ;
201201
const β = 0.018053968510807;
@@ -211,7 +211,7 @@ function lin_2020(RGB) {
211211
//check with standard this really is 2.4 and 1/2.4, not 0.45 was wikipedia claims
212212

213213
function gam_2020(RGB) {
214-
// convert an array of linear-light Rec. 2020 RGB in the range 0.0-1.0
214+
// convert an array of linear-light rec-2020 RGB in the range 0.0-1.0
215215
// to gamma corrected form
216216
const α = 1.09929682680944 ;
217217
const β = 0.018053968510807;
@@ -226,7 +226,7 @@ function gam_2020(RGB) {
226226
}
227227

228228
function lin_2020_to_XYZ(rgb) {
229-
// convert an array of linear-light Rec. 2020 values to CIE XYZ
229+
// convert an array of linear-light rec-2020 values to CIE XYZ
230230
// using D65 (no chromatic adaptation)
231231
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
232232
var M = math.matrix([
@@ -240,7 +240,7 @@ function lin_2020_to_XYZ(rgb) {
240240
}
241241

242242
function XYZ_to_lin_2020(XYZ) {
243-
// convert XYZ to linear-light Rec. 2020
243+
// convert XYZ to linear-light rec-2020
244244
var M = math.matrix([
245245
[1.7166511879712674, -0.35567078377639233, -0.25336628137365974],
246246
[-0.6666843518324892, 1.6164812366349395, 0.01576854581391113],

0 commit comments

Comments
 (0)