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

Re: Gradient syntax proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 15 Aug 2009 11:00:57 -0500
Message-ID: <dd0fbad0908150900t7abfac7dudf734cb00b480100@mail.gmail.com>
To: David Perrell <davidp@hpaa.com>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, Brad Kemper <brad.kemper@gmail.com>, www-style list <www-style@w3.org>
On Sat, Aug 15, 2009 at 10:11 AM, David Perrell<davidp@hpaa.com> wrote:
> Tab Atkins Jr. wrote:
> | I'm still not sure how you're justifying gradients being the same as
> | colors.  They're not, in any way, as I, Brad, and several others in
> | other circumstances have said.  They're an image.
>
> Consensus can be illogical. There are many cases where application of both background linear-gradient and background-image would be useful; there are none where background-color and linear-gradient would need to apply simultaneously.

Incorrect - you're just not being imaginative enough.  Andrew provided
precisely such an example earlier in this thread, and I showed the
code that would be necessary to achieve it.  It was an image with red
coming in from both upper corners and fading to blue.  You would
produce this with:

background: linear-gradient(top left / red, transparent),
linear-gradient(top right / red, transparent), blue;

You cannot have both be "red, blue" gradients, because the top one
would then completely overpaint the bottom one.  You cannot have one
be "red, blue" and one be "red, transparent", because the rgb-space
transition from red->blue looks different than the rgb-space transtion
from red->transparent *over* blue.  Try out the following code in
Safari if you don't believe me:

background: -webkit-gradient(linear, 0% 0%, 50% 100%, from(red),
to(transparent)), -webkit-gradient(linear, 100% 0%, 50% 100%,
from(red), to(blue));

The only way to achieve this sort of effect is to have two gradients
that fade to transparent, over a background color.

> Logically, then, linear-gradient is more akin to color than image. Equating gradient with image lessens its usefulness.

No, CSS simply has limitations in what it can do with paint-servers right now.

~TJ
Received on Saturday, 15 August 2009 16:01:52 GMT

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