Skip to content

Commit 5eba87d

Browse files
committed
Used 'ending-shape' consistently throughout radial gradients. Slight editorial cleanup of some radial gradient paragraphs.
1 parent 388b407 commit 5eba87d

2 files changed

Lines changed: 115 additions & 95 deletions

File tree

css3-images/Overview.html

Lines changed: 96 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -850,9 +850,10 @@ <h3 id=radial-gradients><span class=secno>5.2. </span> Radial Gradients</h3>
850850
<p>A radial gradient is specified by first pinpointing the center of the
851851
gradient, where the 0% ellipse will be, then specifying the size and shape
852852
of the 100% ellipse, ending with a list of color-stops just like a
853-
linear-gradient. Between the center and the ending-ellipse, and past the
854-
ending-ellipse, concentric ellipses are drawn and colored according to the
855-
specified color-stops.</p>
853+
linear-gradient. Between the center and the <a
854+
href="#ending-shape"><i>ending-shape</i></a>, and past the <a
855+
href="#ending-shape"><i>ending-shape</i></a>, concentric ellipses are
856+
drawn and colored according to the specified color-stops.</p>
856857
<!-- ====================================================================== -->
857858

858859
<h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
@@ -870,7 +871,7 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
870871
)
871872
</pre>
872873

873-
<p>The first argument to the function specifies the center of the ellipse.
874+
<p>The first argument to the function specifies the center of the gradient.
874875
The <a href="#ltposition"><code>&lt;position></code></a> value type is
875876
defined as the positioning syntax of &lsquo;<code class=css><a
876877
href="http://www.w3.org/TR/css3-background/#the-background-position">background-position</a></code>&rsquo;
@@ -883,24 +884,29 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
883884
class=css>center</code>&rsquo;.
884885

885886
<p>The second argument to the function specifies the size and shape of the
886-
ending-ellipse. This can be specified in two ways, with different
887+
<dfn id=ending-shape
888+
title="ending-shape|ending-shape's">ending-shape</dfn>, which defines the
889+
shape of the gradient and the locations of percentage-location
890+
color-stops. This can be specified in two ways, with different
887891
characteristics:
888892

889893
<dl>
890894
<dt>Implicitly
891895

892896
<dd>
893-
<p>The size and shape of the ending-ellipse can be defined
897+
<p>The size and shape of the <a
898+
href="#ending-shape"><i>ending-shape</i></a> can be defined
894899
<em>implicitly</em> with a size and shape keyword. The <a
895900
href="#ltshape"><i>&lt;shape></i></a> keyword is defined as:</p>
896901

897902
<pre><code><dfn id=ltshape>&lt;shape></dfn> = circle | ellipse</code></pre>
898903

899-
<p>&lsquo;<code class=css>circle</code>&rsquo; indicates that the
900-
ending-ellipse will be a circle with a constant radius. &lsquo;<code
901-
class=css>ellipse</code>&rsquo; indicates that the gradient-shape will
902-
be an axis-aligned ellipse (that is, its major and minor radiuses will
903-
be horizontal and vertical, not necessarily in that order). If the <a
904+
<p>&lsquo;<code class=css>circle</code>&rsquo; indicates that the <a
905+
href="#ending-shape"><i>ending-shape</i></a> will be a circle with a
906+
constant radius. &lsquo;<code class=css>ellipse</code>&rsquo; indicates
907+
that the gradient-shape will be an axis-aligned ellipse (that is, its
908+
major and minor radiuses will be horizontal and vertical, not
909+
necessarily in that order). If the <a
904910
href="#ltshape"><i>&lt;shape></i></a> is omitted, it defaults to
905911
&lsquo;<code class=css>ellipse</code>&rsquo;.</p>
906912

@@ -919,43 +925,48 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
919925

920926
<dd>
921927
<p>If the <a href="#ltshape"><i>&lt;shape></i></a> is &lsquo;<code
922-
class=css>circle</code>&rsquo;, the ending-shape must be a circle
923-
sized so that it exactly meets the closest side of the box.</p>
928+
class=css>circle</code>&rsquo;, the <a
929+
href="#ending-shape"><i>ending-shape</i></a> must be a circle sized so
930+
that it exactly meets the closest side of the box.</p>
924931

925932
<p>If the <a href="#ltshape"><i>&lt;shape></i></a> is &lsquo;<code
926-
class=css>ellipse</code>&rsquo;, the ending-shape must be an ellipse
927-
sized so that it exactly meets the closest horizontal and vertical
928-
sides of the box.</p>
933+
class=css>ellipse</code>&rsquo;, the <a
934+
href="#ending-shape"><i>ending-shape</i></a> must be an ellipse sized
935+
so that it exactly meets the closest horizontal and vertical sides of
936+
the box.</p>
929937

930938
<dt><dfn id=radial-farthest-side>farthest-side</dfn>
931939

932940
<dd>Same as &lsquo;<a href="#radial-closest-side"><code
933-
class=css>closest-side</code></a>&rsquo;, except the ending-shape must
934-
be sized based on the farthest side(s).
941+
class=css>closest-side</code></a>&rsquo;, except the <a
942+
href="#ending-shape"><i>ending-shape</i></a> must be sized based on the
943+
farthest side(s).
935944

936945
<dt><dfn id=radial-closest-corner>closest-corner</dfn>
937946

938947
<dd>
939948
<p>If the <a href="#ltshape"><i>&lt;shape></i></a> is &lsquo;<code
940-
class=css>circle</code>&rsquo;, the ending-shape must be a circle
941-
sized so that it exactly meets the closest corner of the box.</p>
949+
class=css>circle</code>&rsquo;, the <a
950+
href="#ending-shape"><i>ending-shape</i></a> must be a circle sized so
951+
that it exactly meets the closest corner of the box.</p>
942952

943953
<p>If the <a href="#ltshape"><i>&lt;shape></i></a> is &lsquo;<code
944-
class=css>ellipse</code>&rsquo;, the ending-shape must be an ellipse
945-
with the same aspect-ratio it would have if &lsquo;<a
954+
class=css>ellipse</code>&rsquo;, the <a
955+
href="#ending-shape"><i>ending-shape</i></a> must be an ellipse with
956+
the same aspect-ratio it would have if &lsquo;<a
946957
href="#radial-closest-side"><code
947958
class=css>closest-side</code></a>&rsquo; were specified, but sized so
948959
that it exactly meets the closest corner of the box.</p>
949960

950961
<dt><dfn id=radial-farthest-corner>farthest-corner</dfn>
951962

952963
<dd>Same as &lsquo;<a href="#radial-closest-corner"><code
953-
class=css>closest-corner</code></a>&rsquo;, except the ending-shape
954-
must be sized based on the farthest corner. If <a
955-
href="#ltshape"><i>&lt;shape></i></a> is &lsquo;<code
956-
class=css>ellipse</code>&rsquo;, the ending-shape must have the same
957-
aspect ratio it would have if &lsquo;<a
958-
href="#radial-farthest-side"><code
964+
class=css>closest-corner</code></a>&rsquo;, except the <a
965+
href="#ending-shape"><i>ending-shape</i></a> must be sized based on the
966+
farthest corner. If <a href="#ltshape"><i>&lt;shape></i></a> is
967+
&lsquo;<code class=css>ellipse</code>&rsquo;, the <a
968+
href="#ending-shape"><i>ending-shape</i></a> must have the same aspect
969+
ratio it would have if &lsquo;<a href="#radial-farthest-side"><code
959970
class=css>farthest-side</code></a>&rsquo; were specified.
960971

961972
<dt><dfn id=radial-contain>contain</dfn>
@@ -974,12 +985,12 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
974985
<dt>Explicitly
975986

976987
<dd>
977-
<p>Alternately, the ending-shape's size and shape can be defined
978-
explicitly, by providing two lengths or percentages. These measure the
979-
length of the horizontal and vertical axises of the ellipse,
980-
respectively. (The axis length is the length from the center of the
981-
ellipse to the edge, similar to the radius of a circle, not the
982-
diameter.)</p>
988+
<p>Alternately, the <a href="#ending-shape"><i>ending-shape's</i></a>
989+
size and shape can be defined explicitly, by providing two lengths or
990+
percentages. These measure the length of the horizontal and vertical
991+
axises of the ellipse, respectively. (The axis length is the length from
992+
the center of the ellipse to the edge, similar to the radius of a
993+
circle, not the diameter.)</p>
983994

984995
<p>Percentages used in the first value are relative to the width of the
985996
box, while percentages used in the second value are relative to the
@@ -1001,23 +1012,26 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
10011012
rendered as follows:
10021013

10031014
<dl>
1004-
<dt>If the ending-shape has zero width (regardless of the height):
1005-
1006-
<dd>Render as if the ending-shape was an ellipse whose height was an
1007-
arbitrary very large number and whose width was an arbitrary very small
1008-
number greater than zero. <span class=note>This will make the gradient
1009-
look similar to a horizontal linear gradient that is mirrored across the
1010-
center of the ellipse. It also means that all color-stop positions
1011-
specified with a percentage resolve to &lsquo;<code
1012-
class=css>0px</code>&rsquo;.</span>
1013-
1014-
<dt>Otherwise, if the ending-shape has zero height:
1015-
1016-
<dd>Render as if the ending-shape was an ellipse whose width was an
1017-
arbitrary very large number and whose height was an arbitrary very small
1018-
number greater than zero. <span class=note>This will make the gradient
1019-
look like a solid-color image equal to the color of the last color-stop,
1020-
or equal to the average color of the gradient if it's repeating.</span>
1015+
<dt>If the <a href="#ending-shape"><i>ending-shape</i></a> has zero width
1016+
(regardless of the height):
1017+
1018+
<dd>Render as if the <a href="#ending-shape"><i>ending-shape</i></a> was
1019+
an ellipse whose height was an arbitrary very large number and whose
1020+
width was an arbitrary very small number greater than zero. <span
1021+
class=note>This will make the gradient look similar to a horizontal
1022+
linear gradient that is mirrored across the center of the ellipse. It
1023+
also means that all color-stop positions specified with a percentage
1024+
resolve to &lsquo;<code class=css>0px</code>&rsquo;.</span>
1025+
1026+
<dt>Otherwise, if the <a href="#ending-shape"><i>ending-shape</i></a> has
1027+
zero height:
1028+
1029+
<dd>Render as if the <a href="#ending-shape"><i>ending-shape</i></a> was
1030+
an ellipse whose width was an arbitrary very large number and whose
1031+
height was an arbitrary very small number greater than zero. <span
1032+
class=note>This will make the gradient look like a solid-color image
1033+
equal to the color of the last color-stop, or equal to the average color
1034+
of the gradient if it's repeating.</span>
10211035
</dl>
10221036

10231037
<p>If this argument is omitted, it defaults to &lsquo;<code
@@ -1028,21 +1042,28 @@ <h4 class=no-toc id=radial-gradient-syntax><span class=secno>5.2.1. </span>
10281042
&lsquo;<code class=css>radial-gradient(10% 10%, red, blue)</code>&rsquo;),
10291043
it must be interpreted as a position.
10301044

1031-
<p>Color-stops are placed on an imaginary line extending from the center of
1032-
the gradient toward the right, with the 0% point at the center of the
1033-
gradient, and 100% at the point where the line intersects the
1034-
ending-ellipse. The color of each ellipse is equal to the color of the
1035-
line where the ellipse intersects it. Locations past 100% can be
1036-
specified, and simply indicate a color-stop placed on the line a
1037-
corresponding distance from the center. Negative locations are allowed in
1038-
a radial gradient and work the same as in linear gradients with respect to
1039-
setting the color of the <a
1040-
href="#gradient-line"><i>gradient-line</i></a>, but colors before the
1041-
starting-point of the <a href="#gradient-line"><i>gradient-line</i></a>
1042-
are not displayed. For example, &lsquo;<code class=css>radial-gradient(red
1043-
-50px, yellow 100px)</code>&rsquo; would produce an elliptical gradient
1044-
which starts with a reddish-orange color in the center (the color 1/3
1045-
between red and yellow) and transitions to yellow at 100px wide.
1045+
<p>Color-stops are placed on a <dfn id=gradient-ray>gradient-ray</dfn>,
1046+
similar to the <a href="#gradient-line"><i>gradient-line</i></a> of linear
1047+
gradients. The <a href="#gradient-ray"><i>gradient-ray</i></a> is anchored
1048+
at the center of the gradient and extends toward the right. The 0%
1049+
location is at the start of the <a
1050+
href="#gradient-ray"><i>gradient-ray</i></a>, and the 100% location is on
1051+
the point where the <a href="#gradient-ray"><i>gradient-ray</i></a>
1052+
intersects the <a href="#ending-shape"><i>ending-shape</i></a>. Negative
1053+
locations can be specified; though negative locations are never directly
1054+
consulted for rendering, they can affect the color of non-negative
1055+
locations on the <a href="#gradient-ray"><i>gradient-ray</i></a> through
1056+
interpolation. For example, &lsquo;<code class=css>radial-gradient(red
1057+
-50px, yellow 100px)</code>&rsquo; produces an elliptical gradient that
1058+
starts with a reddish-orange color in the center (specifically, #f50) and
1059+
transitions to yellow. Locations greater than 100% simply specify a
1060+
location a correspondingly greater distance from the center of the
1061+
gradient.
1062+
1063+
<p>When drawing the concentric ellipses of the gradient, the color of each
1064+
ellipse is the color of the <a
1065+
href="#gradient-ray"><i>gradient-ray</i></a> at the point where the
1066+
ellipse intersects the ray.
10461067

10471068
<p class=issue>Brad suggests that we could drop the position/sizing
10481069
arguments and just use background-position and background-size. This would
@@ -2283,6 +2304,12 @@ <h2 class=no-num id=index>Index</h2>
22832304
<li>&lt;element-reference>, <a href="#ltelement-reference"
22842305
title="&lt;element-reference>"><strong>4.3.</strong></a>
22852306

2307+
<li>ending-shape, <a href="#ending-shape"
2308+
title=ending-shape><strong>5.2.1.</strong></a>
2309+
2310+
<li>ending-shape's, <a href="#ending-shape"
2311+
title="ending-shape's"><strong>5.2.1.</strong></a>
2312+
22862313
<li>farthest-corner, <a href="#radial-farthest-corner"
22872314
title=farthest-corner><strong>5.2.1.</strong></a>
22882315

@@ -2299,6 +2326,9 @@ <h2 class=no-num id=index>Index</h2>
22992326
<li>gradient-line, <a href="#gradient-line"
23002327
title=gradient-line><strong>5.1.1.</strong></a>
23012328

2329+
<li>gradient-ray, <a href="#gradient-ray"
2330+
title=gradient-ray><strong>5.2.1.</strong></a>
2331+
23022332
<li>&lt;image>, <a href="#ltimage"
23032333
title="&lt;image>"><strong>4.</strong></a>
23042334

0 commit comments

Comments
 (0)