File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1115,6 +1115,36 @@ any achromatic color will have a [=powerless=] hue component.
11151115 still treat the hue component as [=powerless=] .
11161116 It is intentionally unspecified exactly what "sufficiently close" means for this purpose.
11171117
1118+ <h3 id=parse-color>
1119+ Parsing a <<color>> Value</h3>
1120+
1121+ <div algorithm>
1122+ To <dfn export>parse a CSS <<color>> value</dfn> ,
1123+ given a [=string=] |input|,
1124+ and an optional context <l spec=dom> [=/element=] </l> |element|:
1125+
1126+ 1. [=CSS/Parse=] |input| as a <<color>> .
1127+ If the result is failure,
1128+ return failure;
1129+ otherwise, let |color| be the result.
1130+
1131+ 2. If |element| was passed,
1132+ let |currentcolor| be the [=used value=] of the 'color' property
1133+ on |element|,
1134+ and |color-scheme| be the [=used value=] of the 'color-scheme' property
1135+ on |element|.
1136+
1137+ Otherwise,
1138+ let |currentcolor| and |color-scheme|
1139+ be the [=initial values=] of 'color' and 'color-scheme' , respectively.
1140+
1141+ 3. Let |used color| be the result of [[#resolving-color-values|resolving]] |color|
1142+ to a [=used color=] ,
1143+ using the |currentcolor| and |color-scheme| values if necessary.
1144+
1145+ 4. Return |used color|.
1146+ </div>
1147+
11181148
11191149
11201150
You can’t perform that action at this time.
0 commit comments