Re: Comments on gradient syntax proposal

On Tuesday 2009-10-27 12:15 -0500, Tab Atkins Jr. wrote:
> That makes it more difficult to specify the starting-corner for
> gradients that have an <angle> argument.  Would it be sufficient to
> move the talk of normalization to that section of the spec, avoiding
> any possibility that an implementor accidentally normalizes early?

You can specify the starting corner as:
  bottom-left if sin(angle) >= 0 and cos(angle) >= 0
  bottom-right if sin(angle) < 0 and cos(angle) >= 0
  top-right if sin(angle) < 0 and cos(angle) < 0
  top-left if sin(angle) >= 0 and cos(angle) < 0
(Those work out slightly differently at the vertical/horizontal
cases, but it doesn't matter.)

That said, I think the formulation where the angle-only gradients
have a gradient line going through the center actually turns out
easier to implement (see
https://bugzilla.mozilla.org/show_bug.cgi?id=513395#c48 ).

> > # Between two color-stops, the colors are interpolated as SVG
> > # gradients.
> >
> > The spec ought to say explicitly whether this means that the
> > 'color-interpolation' property applies.  See
> > http://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty
> 
> Should it apply?  I'm not sure.  I don't have a good grasp of SVG.

I'm not sure whether people find the 'linearRGB' option useful.
Mozilla doesn't implement color-interpolation (though we do
implement color-interpolation-filters, I think).

> > In the description of radial gradients:
> >
> > # The image is constructed by creating an infinite canvas and
> > # painting it with concentric copies of the ending-shape, with the
> > # color of the painted shape being the color of the gradient-line
> > # where the two intersect.
> >
> > Saying that ellipses are concentric doesn't define what they are.  I
> > think what you want to say is that they are concentric *and* the
> > ratio of their major axis to minor axis is constant.  (You could,
> > for example, have concentric ellipses that are confocal, but I
> > really don't think that's what's desired here.)
> 
> I have added the word "similar" to that sentence, which should address this.

Well, confocal ellipses are "similar".  It might work if you use
"scaled" instead of "similar" though.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Tuesday, 27 October 2009 20:11:59 UTC