W3C home > Mailing lists > Public > www-style@w3.org > April 2013

[css-images] Gradients with only one color stop

From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 05 Apr 2013 14:46:30 +0200
Message-ID: <515EC7A6.4090900@exyr.org>
To: "www-style@w3.org" <www-style@w3.org>
Hi,

The syntax allows gradients with only one color stop. It pretty obvious 
that they should render as a solid color, but the spec does not say that 
explicitly.

Still, the non-repeating case is well-defined thanks to this sentence in 
4.4:

> Before the first color-stop, the line is the color of the first
> color-stop. After the last color-stop, the line is the color of the
> last color-stop.


For repeating gradients, however, the spec might need some 
clarification. In particular, in this paragraph of 4.3:

> If the distance between the first and last color-stops is zero (or
> rounds to zero due to implementation limitations), the implementation
> must find the average color of a gradient with the same number and
> color of color-stops, but with the first and last color-stops an
> arbitrary non-zero distance apart, and the remaining color-stops
> equally spaced between them. Then it must render the gradient as a
> solid-color image equal to that average color.

"the first and last color-stops an arbitrary non-zero distance apart" 
does not make sense when the first and last are the same point.

I suggest adding "Otherwise," at the beginning of the quoted paragraph, 
and adding just before it:

> If the gradient has only one color-stop, then it must render as a
> solid-color image equal to the color of the only color-stop.

-- 
Simon Sapin
Received on Friday, 5 April 2013 12:46:56 UTC

This archive was generated by hypermail 2.3.1 : Friday, 5 April 2013 12:46:57 UTC