W3C home > Mailing lists > Public > www-style@w3.org > August 2011

[css3-images] too-small repeating gradients

From: Brian Manthos <brianman@microsoft.com>
Date: Wed, 3 Aug 2011 23:20:31 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D17111583@TK5EX14MBXC264.redmond.corp.microsoft.com>
Tab:
> 1. Changed the handling of too-small repeating gradients to render as the average color.

http://dev.w3.org/csswg/css3-images/#color-stop-syntax


The 8/2 version has two descriptions:

(A)
repeating-linear-gradient(red 5px, white 5px, blue 5px);
# If the distance between the first and last color-stops is zero,
# the gradient must be rendered as a solid-color image equal
# to the "average" color of the gradient, determined by linearly
# blending the colors of all the color-stops in premultipied sRGBA space.

(B)
repeating-linear-gradient(red 5px, white, blue 5.00000000000000000000000000000000000000000000000000000000000001px);
(Algorithm described)


I believe that...

For case (A) the expected result is equal contributions from red, white, and blue.
For case (B), the expected result is 25% red, 50% white, and 25% blue contributions.

If this is correct, there is a discontinuity between (A) and (B).

Questions:
(1) Is my interpretation of the language incorrect?
(2) If no to (1), I prefer (B) and suggest an adjustment to the language for case (A) so that it produces the same result as case (B).


[Minor note courtesy of spell-checker: "premultipied" is missing the second L in the spec phrasing for case A.]
Received on Wednesday, 3 August 2011 23:21:01 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:43 GMT