Skip to content

Commit d61c49c

Browse files
committed
[css-color] Rearrange some sections.
1 parent b706bd7 commit d61c49c

2 files changed

Lines changed: 297 additions & 284 deletions

File tree

css-color/Overview.bs

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Foreground Color: the 'color' property</h2>
9292
</dl>
9393

9494
<h2 id='color-type'>
95-
RGB Colors: the <<color>> type</h2>
95+
Representing Colors: the <<color>> type</h2>
9696

9797
CSS colors are represented by a triplet of values--
9898
red, green, and blue--
@@ -135,20 +135,38 @@ RGB Colors: the <<color>> type</h2>
135135
a color is <a>achromatic</a> if the sum of the whiteness and blackness is at least ''100%''.
136136

137137

138-
<h3 id='the-rgba-function'>
138+
139+
<h3 id="notes">
140+
Notes On Using Colors</h3>
141+
142+
Although colors can add significant amounts of information to
143+
document and make them more readable, please consider the
144+
W3C Web Content Accessibility Guidelines [[WCAG20]] when including color in your documents.
145+
146+
<ul>
147+
<li><a href="http://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-without-color"><em>1.4.1 Use of Color:</em> Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element</a>
148+
</ul>
149+
150+
151+
<h2 id='numeric-rgb'>
152+
RGB Colors</h2>
153+
154+
There are several methods of directly specifying a color in terms of its RGBA channels.
155+
156+
<h3 id='rgb-functions'>
139157
The RGB functions: ''rgb()'' and ''rgba()''</h3>
140158

141159
The ''rgb()'' function defines an RGB color by specifying the red, green, and blue channels directly.
142160
Its syntax is:
143161

144162
<pre class='prod'>
145-
<dfn>rgb()</dfn> = rgb( <<component>>, <<component>>, <<component>> )
146-
<dfn>rgba()</dfn> = rgba(<<component>>, <<component>>, <<component>>, <<alpha-value>> )
147-
<dfn>&lt;component></dfn> = <<number>> | <<percentage>>
163+
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} )
164+
<dfn>rgba()</dfn> = rgba( <<rgb-component>>#{3} , <<alpha-value>> )
165+
<dfn>&lt;rgb-component></dfn> = <<number>> | <<percentage>>
148166
<dfn>&lt;alpha-value></dfn> = <<number>> | <<percentage>>
149167
</pre>
150168

151-
The three <<component>>s specify the red, green, and blue channels of the color, respectively.
169+
The three <<rgb-component>>s specify the red, green, and blue channels of the color, respectively.
152170
''0%'' represents the minimum value for that color channel in the sRGB gamut,
153171
and ''100%'' represents the maximum value.
154172
A <<number>> is equivalent to a <<percentage>>,
@@ -252,8 +270,8 @@ The RGB hexadecimal notations: ''#RRGGBB''</h3>
252270

253271

254272

255-
<h3 id='named-colors'>
256-
Named Colors</h3>
273+
<h2 id='named-colors'>
274+
Named Colors</h2>
257275

258276
In addition to the various numeric syntaxes for <<color>>s,
259277
CSS defines a large set of <dfn id="named-color" title="named color" export>named colors</dfn> that can be used instead,
@@ -581,17 +599,17 @@ Named Colors</h3>
581599

582600
Note: this list of colors and their definitions is identical to the list of <a href="http://www.w3.org/TR/SVG/types.html#ColorKeywords">named colors defined by SVG 1.1</a>.
583601

584-
<h4 id='transparent-color'>
585-
The ''transparent'' keyword</h4>
602+
<h3 id='transparent-color'>
603+
The ''transparent'' keyword</h3>
586604

587605
The keyword <dfn value for="<color>">transparent</dfn> specifies a transparent black color;
588606
that is, a color with its red, green, and blue channels all set to the minimum value
589607
and its alpha channel set to full transparency,
590608
equivalent to ''rgba(0, 0, 0, 0)''.
591609

592610

593-
<h4 id='currentcolor-color'>
594-
The ''currentcolor'' keyword</h4>
611+
<h3 id='currentcolor-color'>
612+
The ''currentcolor'' keyword</h3>
595613

596614
The keyword <dfn value for="<color>">currentcolor</dfn> takes its value from the value of the 'color' property on the same element.
597615
This happens at <strong>used-value time</strong>,
@@ -651,8 +669,8 @@ The ''currentcolor'' keyword</h4>
651669
as CSS keywords are case-insensitive.
652670

653671

654-
<h4 id='simple-hues'>
655-
Simple Named Hues: the <<named-hue>> term</h4>
672+
<h3 id='simple-hues'>
673+
Simple Named Hues: the <<named-hue>> term</h3>
656674

657675
The ''hsl()'' and ''hwb()'' notations both start from a saturated hue,
658676
and then modify it in various ways to achieve the exact color desired.
@@ -698,8 +716,8 @@ Simple Named Hues: the <<named-hue>> term</h4>
698716
it's equivalent to specifying the first hue as a functional <<splash-hue>> with the argument ''50%''.
699717
That is, ''green blue'' specifies the same color as ''greenish(50%) blue''.
700718

701-
<h5 id='named-hue-examples'>
702-
Examples of Simple Named Hues</h5>
719+
<h4 id='named-hue-examples'>
720+
Examples of Simple Named Hues</h4>
703721

704722
There are a total of 24 named hues not using the functional notation,
705723
arranged evenly around the color wheel:
@@ -796,19 +814,6 @@ Examples of Simple Named Hues</h5>
796814

797815

798816

799-
<h3 id="notes">
800-
Notes On Using Colors</h3>
801-
802-
Although colors can add significant amounts of information to
803-
document and make them more readable, please consider the
804-
W3C Web Content Accessibility Guidelines [[WCAG20]] when including color in your documents.
805-
806-
<ul>
807-
<li><a href="http://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-without-color"><em>1.4.1 Use of Color:</em> Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element</a>
808-
</ul>
809-
810-
811-
812817

813818
<h2 id='the-hsl-notation'>
814819
HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>

0 commit comments

Comments
 (0)