Re: Talk on radial gradients

On Aug 24, 2009, at 6:55 AM, Tab Atkins Jr. wrote:

> On Sun, Aug 23, 2009 at 11:43 PM, Simon Fraser<smfr@me.com> wrote:
>> On Aug 23, 2009, at 11:18 am, Tab Atkins Jr. wrote:
>>> Second, I don't think an ending circle is necessary *at all*, with a
>>> point or radius.  As I mentioned above, in every case of a radial
>>> ...
>> I'm not sure I agree here. You could imaging a radial gradient  
>> background
>> being used to highlight a foreground item. In that case you'd want to
>> gradient
>> to be a lot smaller than the box. Sure, you could add a color-stop,  
>> but ever
>> additional color-stop adds complexity.
>
> If you're highlighting a foreground item, you'll have to know how
> large the item is and where it's positioned.  If you know that, you
> can make yourself a gradient in any common image editor.

You can use getBoundingClientRect in JS. Pre-canned images would
not work with flexible layouts.

My point is not to dwell on this particular case, but to make the point
that the assumption that authors almost always want radial gradients
to fill the box may not be valid.

>>> Third, and this is something I'm not completely sure on yet but  
>>> think
>>> is probably important, you should be able to specify elliptical
>>> shapes.
>>
>> I agree, but FYI elliptical shapes are not supported by Core  
>> Graphics on
>> Mac,
>> so there may be significant impediments to implementation.
>
> Hrm.  That's a problem.  Without ellipses, though, radial gradients
> are kinda useless.  By far their most common use on the web, I
> believe, is to fill boxes according the box's shape.
>
> That might be why Hyatt only did circular gradients at first.
>
> However, SVG handles elliptical gradients just fine (just coded one
> for myself to be sure).  How do you draw them on the Mac?

It transforms the graphics context, which we can do for CSS gradients
as well, so go nuts with ellipticals!

Simon

Received on Monday, 24 August 2009 16:31:26 UTC