Re: Linear gradients, Transforms and angles...

On Sep 23, 2010, at 5:48 PM, Brad Kemper wrote:
>> ...
>> I have no idea what you mean by this.  We're talking about an element rotated by X, and an element with a gradient rotated by X.  Not radial gradients.
> 
> Linear gradients. The thing about them is that they are linear. As in "line". A straight direction. They are therefore different from, say, 'transform:rotate()' in which something is actually rotated. Most authors will not think of a 45deg linear gradient as being a left-right angle that has been rotated 45deg. It is just a direction, a straight direction. NOT something that has been rotated. That direction is measured in degrees because it can be thought of as a ray pointing outward from it's starting point, as if you centered a protractor on that point. There is a relative distance of circular arc that (when measured in degrees) tells you what direction the ray is pointing, but the ray itself is one-dimensional in its direction, unlike an actual rotation. 
> 
> So just because linear directions and rotations both are measured in degrees does not mean that you can't intuitively have positive numbers mean clockwise for _rotations_, but still follow the standard geometry convention for specifying _linear_ direction.

It's taken me a while to realize that you're not suggesting we change the definition of ALL rotations to be counter-clockwise, just the direction of gradients, is that right? If so, then you must believe "linear direction" is somehow fundamentally different from "rotation" to make the inconsistency reasonable. II understand the argument, but I disagree with it. If we are trying to make HTML "author friendly" there are many ways to do that. One is to use concepts familiar to authors, so making angles behave in a way that authors are familiar with is a good criteria. But another is to lower the level of knowledge and experience and author needs. And another is to make the concepts consistent. I think having the angle of linear direction and rotations behave the same achieves those last two criteria.

I have a lot of experience in dealing with geometric concepts and the idea that rotating a box and supplying a direction vector for gradients are two fundamentally different things just doesn't make sense to me. For me the visual model for rotating a box is to start with a piece of axis aligned paper on a desk, grab it and spin it until it is at the correct angle. For setting the direction of a gradient, I also start with a piece of axis aligned paper, this time with a nice color gradient on it, and spin it until the gradient is at the correct angle. I don't see the difference. I don't think authors on the street will either.

HTML really needs words in the various sections where we specify angles. Something like:

	CSS Transforms specify angles as a clockwise rotation about the selected axis. This is different from the counter-clockwise 
	rotations you may be used to from geometry class. The reason for this is because in the HTML coordinate space has the Y 
	axis going down rather than up because that how you (often) read a page of text. Since the Y axis is flipped, the direction of 
	rotation is flipped, too.

If all angular motion is the same, we can make this a general statement. If the angles used for gradient directions behave differently, we'll need yet another statement that says, "oh, for gradients angles are counter-clockwise unlike everything else". This gives authors yet another thing to remember.

I understand the advantages of your argument, I just think the consistency argument is stronger.

-----
~Chris
cmarrin@apple.com

Received on Sunday, 26 September 2010 20:05:42 UTC