Skip to content

Commit 355e596

Browse files
author
curation-bot
committed
Publish curated data from 78b9e90
Curated data generated from raw data at 78b9e90
1 parent f4e9ad0 commit 355e596

34 files changed

+978
-735
lines changed

ed/algorithms/css-color-5.json

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,52 @@
55
},
66
"algorithms": [
77
{
8-
"html": "Percentages are required to be in the range 0% to 100%. Negative percentages are specifically disallowed. The percentages are normalized as follows:",
9-
"rationale": "let",
8+
"name": "calculate a color-mix()",
9+
"href": "https://drafts.csswg.org/css-color-5/#calculate-a-color-mix",
10+
"html": "To <dfn class=\"dfn-paneled has-dfn-panel\" data-dfn-type=\"dfn\" data-export=\"\" id=\"calculate-a-color-mix\" role=\"button\" aria-expanded=\"false\" tabindex=\"0\">calculate a color-mix()</dfn>:",
11+
"rationale": ".algorithm",
1012
"steps": [
1113
{
12-
"html": "<p>Let <var>p1</var> be the first percentage and <var>p2</var> the second one.</p>"
14+
"html": "<p><a data-link-type=\"dfn\">Normalize mix percentages</a> from the list of <span>mix items</span> passed to the function,\nwith the \"forced normalization\" flag set to true,\nletting <var>items</var> and <var>leftover</var> be the result.</p>"
1315
},
1416
{
15-
"html": "<p>If both percentages are omitted, they each default to 50%\n(an equal mix of the two colors).</p>"
17+
"html": "<p>If <var>leftover</var> is 100%,\nreturn <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-color-4/#transparent-black\" id=\"ref-for-transparent-black\">transparent black</a>,\nconverted to the specified interpolation <a class=\"production css\" data-link-type=\"type\" href=\"https://drafts.csswg.org/css-color-5/#typedef-color-space\" id=\"ref-for-typedef-color-space①\">&lt;color-space&gt;</a>.</p>"
1618
},
1719
{
18-
"html": "<p>Otherwise, if <var>p2</var> is omitted, it becomes 100% - <var>p1</var></p>"
20+
"html": "<p>Let <var>alpha mult</var> be <code>1 - <var>leftover</var></code>,\ninterpreting <var>leftover</var> as a number between 0 and 1.</p>"
1921
},
2022
{
21-
"html": "<p>Otherwise, if <var>p1</var> is omitted, it becomes 100% - <var>p2</var></p>"
23+
"html": "Otherwise:",
24+
"rationale": "let",
25+
"steps": [
26+
{
27+
"html": "<p>Let <var>item stack</var> be a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#stack\" id=\"ref-for-stack\">stack</a> made by reversing <var>items</var>.\n(Thus, with the first item at the top of the stack.)</p>"
28+
},
29+
{
30+
"html": "While <var>item stack</var> has length 2 or greater:",
31+
"rationale": "pop",
32+
"steps": [
33+
{
34+
"html": "<p><a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#stack-pop\" id=\"ref-for-stack-pop\">Pop</a> from <var>item stack</var> twice,\nletting <var>a</var> and <var>b</var> be the two results in order.\nLet <var>combined percentage</var> be the sum of <var>a</var> and <var>b</var>’s percentages.</p>"
35+
},
36+
{
37+
"html": "<p>Interpolate <var>a</var> and <var>b</var>’s colors\nas described in <a href=\"https://drafts.csswg.org/css-color-4/#interpolation\"><cite>CSS Color 4</cite> §  12. Color Interpolation</a>,\nwith a progress percentage equal to <code>(<var>b</var>’s percentage) / <var>combined percentage</var>)</code>.\nIf the specified color space is a <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-color-4/#cylindrical-polar-color\" id=\"ref-for-cylindrical-polar-color①\">cylindrical polar color</a> space,\nthen the <a class=\"production css\" data-link-type=\"type\" href=\"https://drafts.csswg.org/css-color-5/#typedef-hue-interpolation-method\" id=\"ref-for-typedef-hue-interpolation-method\">&lt;hue-interpolation-method&gt;</a> controls the\ninterpolation of hue, as described in <a href=\"https://drafts.csswg.org/css-color-4/#hue-interpolation\"><cite>CSS Color 4</cite> § 12.4 Hue Interpolation</a>.\nIf no <span class=\"production\" id=\"ref-for-typedef-hue-interpolation-method①\">&lt;hue-interpolation-method&gt;</span> is specified,\nassume <span class=\"css\">shorter</span>.</p>"
38+
},
39+
{
40+
"html": "<p>Create a new <a data-link-type=\"dfn\">mix item</a> with the resulting color\nand a percentage of <var>combined percentage</var>,\nand <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#stack-push\" id=\"ref-for-stack-push\">push</a> it onto <var>item stack</var>.</p>"
41+
}
42+
]
43+
},
44+
{
45+
"html": "<p>Set <var>color</var> to the color of the sole remaining item in <var>item stack</var>.</p>"
46+
}
47+
]
2248
},
2349
{
24-
"html": "<p>Otherwise, if both are provided and add up to greater than 100%,\nthey are scaled accordingly so that they add up to 100%.</p>"
50+
"html": "<p>Multiply the alpha component of <var>color</var> by <var>alpha mult</var>.</p>"
2551
},
2652
{
27-
"html": "<p>Otherwise, if both are provided and add up to less than 100%,\nthe sum is saved as an alpha multiplier.\nIf the sum is greater than zero,\nthey are then scaled accordingly so that they add up to 100%.</p>"
28-
}
29-
]
30-
},
31-
{
32-
"html": "After normalizing both percentages, the result is produced via the following algorithm:",
33-
"rationale": "if",
34-
"steps": [
35-
{
36-
"html": "<p>If the alpha multiplier is zero, the result is <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-color-4/#valdef-color-transparent\" id=\"ref-for-valdef-color-transparent\">transparent</a>, converted to the specified interpolation <a class=\"production css\" data-link-type=\"type\" href=\"https://drafts.csswg.org/css-color-5/#typedef-color-space\" id=\"ref-for-typedef-color-space①\">&lt;color-space&gt;</a></p>"
37-
},
38-
{
39-
"html": "<p>Otherwise, as described in <a href=\"https://drafts.csswg.org/css-color-4/#interpolation\"><cite>CSS Color 4</cite> §  12. Color Interpolation</a>,\nboth colors are converted to the specified interpolation <a class=\"production css\" data-link-type=\"type\" href=\"https://drafts.csswg.org/css-color-5/#typedef-color-space\" id=\"ref-for-typedef-color-space②\">&lt;color-space&gt;</a>,\ntaking into account any <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-color-4/#analogous-components\" id=\"ref-for-analogous-components\">analogous components</a>.</p>"
40-
},
41-
{
42-
"html": "<p>Colors are then interpolated in the \tspecified color space,\nas described in <a href=\"https://drafts.csswg.org/css-color-4/#interpolation\"><cite>CSS Color 4</cite> §  12. Color Interpolation</a>.\nIf the specified color space is a <span class=\"css\">cylindrical-polar-color</span> space,\nthen the <a class=\"production css\" data-link-type=\"type\" href=\"https://drafts.csswg.org/css-color-5/#typedef-hue-interpolation-method\" id=\"ref-for-typedef-hue-interpolation-method\">&lt;hue-interpolation-method&gt;</a> controls the\ninterpolation of hue, as described in <a href=\"https://drafts.csswg.org/css-color-4/#hue-interpolation\"><cite>CSS Color 4</cite> § 12.4 Hue Interpolation</a>.\nIf no <span class=\"production\" id=\"ref-for-typedef-hue-interpolation-method①\">&lt;hue-interpolation-method&gt;</span> is specified, it is as if <span class=\"css\">shorter</span> had been specified.</p>"
43-
},
44-
{
45-
"html": "<p>If an alpha multiplier was produced during percentage normalization,\nthe alpha component of the interpolated result is multiplied\nby the alpha multiplier.</p>"
53+
"html": "<p>Return <var>color</var>.</p>"
4654
}
4755
]
4856
},

ed/algorithms/css-flexbox-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"html": "Otherwise,\n\t\t\t\t\tif the used <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-flex-basis\" id=\"ref-for-flex-flex-basis⑥\">flex basis</a> is <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-content\" id=\"ref-for-valdef-flex-basis-content⑧\">content</a> or depends on its <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-sizing-3/#available\" id=\"ref-for-available②\">available space</a>,\n\t\t\t\t\tthe available main size is infinite,\n\t\t\t\t\tand the flex item’s inline axis is parallel to the main axis,\n\t\t\t\t\tlay the item out using <a href=\"https://www.w3.org/TR/css3-writing-modes/#orthogonal-flows\">the rules for a box in an orthogonal flow</a> <a data-link-type=\"biblio\" href=\"https://drafts.csswg.org/css-flexbox-1/#biblio-css3-writing-modes\" title=\"CSS Writing Modes Level 3\">[CSS3-WRITING-MODES]</a>.\n\t\t\t\t\tThe <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-base-size\" id=\"ref-for-flex-base-size④\">flex base size</a> is the item’s max-content <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#main-size\" id=\"ref-for-main-size①①\">main size</a>."
6969
},
7070
{
71-
"html": "Otherwise,\n\t\t\t\t\tsize the item into the <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-sizing-3/#available\" id=\"ref-for-available③\">available space</a> using its used <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-flex-basis\" id=\"ref-for-flex-flex-basis⑦\">flex basis</a> in place of its <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#main-size\" id=\"ref-for-main-size①②\">main size</a>,\n\t\t\t\t\ttreating a value of <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-content\" id=\"ref-for-valdef-flex-basis-content⑨\">content</a> as <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-sizing-3/#valdef-width-max-content\" id=\"ref-for-valdef-width-max-content\">max-content</a>.\n\t\t\t\t\tIf a <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#cross-size\" id=\"ref-for-cross-size①②\">cross size</a> is needed to determine the <span id=\"ref-for-main-size①③\">main size</span> (e.g. when the <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-item\" id=\"ref-for-flex-item⑨④\">flex item</a>’s <span id=\"ref-for-main-size①④\">main size</span> is in its block axis,\n\t\t\t\t\tor when it has a <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-sizing-4/#preferred-aspect-ratio\" id=\"ref-for-preferred-aspect-ratio④\">preferred aspect ratio</a>)\n\t\t\t\t\tand the <span id=\"ref-for-flex-item⑨⑤\">flex item</span>’s cross size is <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-auto\" id=\"ref-for-valdef-flex-basis-auto③\">auto</a> and not <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#definite\" id=\"ref-for-definite①⓪\">definite</a>,\n\t\t\t\t\tin this calculation use <span class=\"css\">fit-content</span> as the <span id=\"ref-for-flex-item⑨⑥\">flex item</span>’s <span id=\"ref-for-cross-size①③\">cross size</span>.\n\t\t\t\t\tThe <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-base-size\" id=\"ref-for-flex-base-size⑤\">flex base size</a> is the item’s resulting <span id=\"ref-for-main-size①⑤\">main size</span>."
71+
"html": "Otherwise,\n\t\t\t\t\tsize the item into the <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-sizing-3/#available\" id=\"ref-for-available③\">available space</a> using its used <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-flex-basis\" id=\"ref-for-flex-flex-basis⑦\">flex basis</a> in place of its <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#main-size\" id=\"ref-for-main-size①②\">main size</a>,\n\t\t\t\t\ttreating a value of <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-content\" id=\"ref-for-valdef-flex-basis-content⑨\">content</a> as <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-sizing-3/#valdef-width-max-content\" id=\"ref-for-valdef-width-max-content\">max-content</a>.\n\t\t\t\t\tIf a <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#cross-size\" id=\"ref-for-cross-size①②\">cross size</a> is needed to determine the <span id=\"ref-for-main-size①③\">main size</span> (e.g. when the <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-item\" id=\"ref-for-flex-item⑨④\">flex item</a>’s <span id=\"ref-for-main-size①④\">main size</span> is in its block axis,\n\t\t\t\t\tor when it has a <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-sizing-4/#preferred-aspect-ratio\" id=\"ref-for-preferred-aspect-ratio④\">preferred aspect ratio</a>)\n\t\t\t\t\tand the <span id=\"ref-for-flex-item⑨⑤\">flex item</span>’s cross size is <a class=\"css\" data-link-type=\"maybe\" href=\"https://drafts.csswg.org/css-flexbox-1/#valdef-align-items-auto\" id=\"ref-for-valdef-align-items-auto①\">auto</a> and not <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#definite\" id=\"ref-for-definite①⓪\">definite</a>,\n\t\t\t\t\tin this calculation use <span class=\"css\">fit-content</span> as the <span id=\"ref-for-flex-item⑨⑥\">flex item</span>’s <span id=\"ref-for-cross-size①③\">cross size</span>.\n\t\t\t\t\tThe <a data-link-type=\"dfn\" href=\"https://drafts.csswg.org/css-flexbox-1/#flex-base-size\" id=\"ref-for-flex-base-size⑤\">flex base size</a> is the item’s resulting <span id=\"ref-for-main-size①⑤\">main size</span>."
7272
}
7373
]
7474
},

0 commit comments

Comments
 (0)