Skip to content

Commit 9450348

Browse files
committed
[css-color] @Profile, rgb to xyz utility code
1 parent 0b206bc commit 9450348

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

css-color/Overview.bs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,10 +1772,17 @@ are the same for colors inside the source and destination gamuts.
17721772
<h3 id="at-profile">Specifying a color profile: the ''profile'' at-rule</h3>
17731773
<!-- we agreed to call it profile rather than color-profile or icc-profile, for brevity -->
17741774

1775-
In a very similar way to the ''<@font-face.'' at-rule, the ''<@profile>'' at-rule has a descriptor
1775+
The <dfn data-dfn-type='at-rule' id="at-ruledef-profile">@profile</dfn>
1776+
rule is a group rule. It consists of the at-keyword
1777+
'@profile' followed by an identifier, followed by a group rule body.
1778+
1779+
In a very similar way to the ''<@font-face.'' at-rule, the ''<@profile>''
1780+
at-rule has a descriptor
17761781
to give the profile a name which will be used inside the stylesheet,
17771782
<!-- is this actualy a descriptor, or a parameter to the at-rule?-->
1778-
and another descriptor to point to the actual data ('src', just like 'src'' in font-face.)
1783+
and another descriptor to point to the actual
1784+
data (<dfn for="@profile/src">src</dfn>, just like
1785+
<dfn for="@font-face/src">src</dfn> in font-face.)
17791786
<!-- not clear how I link to the two different descriptors therte, in bikeshed syntax -->
17801787

17811788
<!-- should we add a format field to this descriptor, like with font-face src? it is always ICC format
@@ -1786,7 +1793,7 @@ In adition there is a third, optional descriptor to define the ''rendering inten
17861793
This is only needed if the profile linked to has data for multiple rendering intents.
17871794

17881795
<pre class="prod">
1789-
<dfn at-rule
1796+
<dfn at-rule>FIXME</dfn>
17901797
</pre>
17911798

17921799
<h2 id='cmyk-colors'>

css-color/matrixmaker.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
const xwhite=0.3127 ;
2525
const ywhite=0.3290 ;
2626

27+
// Relative XYZ values. Copy-paste-o-rama
28+
var XWhite=xwhite/ywhite;
29+
var YWhite=1;
30+
var ZWhite=(1 - xwhite - ywhite)/ywhite;
31+
32+
var XRed=xred/yred;
33+
var YRed=1;
34+
var ZRed=(1 - xred - yred)/yred;
35+
36+
var XGreen=xgreen/ygreen;
37+
var YGreen=1;
38+
var ZGreen=(1 - xgreen - ygreen)/green;
39+
40+
var white = math.matrix([])
2741

2842
</script>
2943
</html>

0 commit comments

Comments
 (0)