W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: Colour gradient backgrounds.

From: Chris Lilley <chris@w3.org>
Date: Mon, 10 May 2004 21:00:06 +0200
Message-ID: <117808196.20040510210006@w3.org>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: "Max Romantschuk" <max@provico.fi>, www-style@w3.org

On Monday, May 10, 2004, 7:57:11 PM, Andrew wrote:


>>
>> Robin Berjon wrote:
>> > Andrew Fedoniouk wrote:
>> >
>> >> background-color:
>> >>
>> gradient(colorTopLeft,colorTopRight,colorBottomLeft,colorBottomRight)
>> >
>> > That's still not very generic. A good way to do that would be to simply
>> > use SVG. It'll do the job very well.
>>
>> I agree. Introducing this into CSS would create unnecessary
>> redundancies. CSS should allow for styling, but actual graphical
>> elements (like a non-solid colored background) is best kept in images.
>>

AF> I agree too. If we will implement non-solid colored background with
AF> *stretch*
AF> [e.g.
AF> http://lists.w3.org/Archives/Public/www-style/2004May/0009.html]
AF> this will cover gradient cases.

Yes, it will. The need for a background image to stretch, as an
alternative to tiling, had been known for some time.

AF> Only one: gradient is easy to implement and being implemented it is and will
AF> be popular.

I agree that gradients in SVG have already been implemented for years,
are easy and popular. I disagree with your next statement:

AF> But images for gradient fill are not so good to be compressed effectively.

This is incorrect. Even for raster images, PNG and to an extent JPEG
are able to compress a vertical gradient well and a horizontal
gradient moderately well. GIF can't, but, well, its not a very good
format.

SVG can express a gradient very compactly, as it only stores the
colors, opacities and positions of the gradient stops plus the type of
gradient (radial or linear), the angle and skew of the gradient, and
treatment of colors past the end stops(pad, repeat, reflect).


AF> As you might know IE has gradient feature already.

As you might know SVG has a gradient feature already. But that does
not affect CSS in terms of the spec. The CSS spec merely says
that images can be used as backgrounds; adding an option to stretch
rather than tile is all that is required.

SVG already places an additional conformance criterion on
implementations that do both CSS and SVG, so with the stretch addition
to CSS we would be all set.




-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 Member, W3C Technical Architecture Group
Received on Monday, 10 May 2004 15:00:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:29 GMT