You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Its values are defined in the list below. For the purpose of these definitions, consider the box edges as extending infinitely in both directions, rather than being finite line segments.</p>
<p>If the <i><shape></i> is ''circle'', the ending-shape must be a circle sized so that it exactly meets the closest side of the box.</p>
545
+
546
+
<p>If the <i><shape></i> is ''ellipse'', the ending-shape must be an ellipse sized so that it exactly meets the closest horizontal and vertical sides of the box.</p>
<p>If the <i><shape></i> is ''circle'', the ending-shape must be a circle sized so that it exactly meets the closest corner of the box.</p>
555
+
556
+
<p>If the <i><shape></i> is ''ellipse'', the ending-shape must be an ellipse with the same aspect-ratio it would have if ''closest-side'' were specified, but sized so that it exactly meets the closest corner of the box.</p>
<dd>Same as ''closest-corner'', except the ending-shape must be sized based on the farthest corner. If <i><shape></i> is ''ellipse'', the ending-shape must have the same aspect ratio it would have if ''farthest-side'' were specified.</dd>
561
+
562
+
<dt><dfnid='radial-contain'>contain</dfn></dt>
563
+
<dd>This value is an alias for ''closest-side'', and has the same meaning.</dd>
564
+
565
+
<dt><dfnid='radial-cover'>cover</dfn></dt>
566
+
<dd>This value is an alias for ''farthest-corner'', and has the same meaning.</dd>
the box, while percentages used in the second value are relative to
578
581
the height of the box.</p>
579
582
580
-
<p>Both of the values must be non-negative. Specifying either as
581
-
''0'' is allowed, but produces a degenerate shape. The handling of
582
-
degenerate ending-shapes is specified later in this specification.</p>
583
+
<p>Negative lengths or percentages are a syntax error.</p>
583
584
</dd>
584
585
</dl>
585
586
587
+
<p>Some combinations of position, size, and shape will produce a <dfn>degenerate shape</dfn> - a circle or ellipse with a radius of 0. This will occur if the position is on a box edge and the second argument is ''circle closest-side'', ''ellipse closest-side'', or ''ellipse closest-corner'', or if the position is on a box corner and the shape is ''closest-corner'', or if the size and shape are given explicitly and either of the radiuses are ''0''. In these instances, the the gradient represents a solid-color image equal to the color of the last color-stop.</p>
588
+
586
589
<p>If this argument is omitted, it defaults to ''ellipse cover''.</p>
587
590
588
591
<p>If only one argument is provided before the color-stops, and it could
589
592
be interpreted as either a position or an explicit size (for example, in
590
593
''radial-gradient(10% 10%, red, blue)''), it must be interpreted as a position.</p>
591
594
592
-
<p>In certain circumstances the given parameters may define a degenerate
593
-
shape - a circle or ellipse with a radius of 0. In these instances the
594
-
gradient image is just a solid color equal to the color of the last color-stop
595
-
in the rule. The following combinations of values will trigger this:
596
-
''closest-side'' if the starting-point is on a box edge, ''closest-corner''
597
-
if the starting-point is on a box corner, and ''ellipse closest-corner''
598
-
if the starting-point is on a box edge.</p>
599
-
600
595
<p>Color-stops are placed on an imaginary line extending from the center
601
596
of the gradient toward the right, with the 0% point at the center of the
602
597
gradient, and 100% at the point where the line intersects the ending-ellipse.
@@ -705,7 +700,7 @@ <h3 id='repeating-gradients'>
705
700
706
701
<pre><code>repeating-radial-gradient(20px 30px, circle contain, red, yellow, green 100%, yellow 150%, red 200%)</code></pre>
707
702
<p><imgsrc="repeating3.png" alt=""></p>
708
-
</div>
703
+
</div>
709
704
710
705
<p>If the distance between the first and last color-stops is non-zero, but is small enough that the implementation knows that the physical resolution of the output device is insufficient to faithfully render the gradient, the implementation must <ititle="gradient-average-color">find the average color of the gradient</i> and render the gradient as a solid-color image equal to the average color.</p>
0 commit comments