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

Re: [css3-images] Changing the angles in gradients

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 18 May 2011 09:40:32 -0700
Cc: www-style@w3.org
Message-Id: <5F8DC423-10F1-4946-9E71-632CDA2F5CA7@gmail.com>
To: Mihai Potra <mike@mpotra.com>

On May 17, 2011, at 7:29 PM, Mihai Potra wrote:

> On 5/18/2011 02:27 AM, Brad Kemper wrote:
>> On May 17, 2011, at 3:33 PM, "Eric A. Meyer"<eric@meyerweb.com>  wrote:
>>>>> On 05/17/2011 12:57 PM, Tab Atkins Jr. wrote:
>>>>>> So, we have three choices:
>>>>>> A) Keep the angles as they are, with 0deg=East and 90deg=North
>>>>>> B) Switch to screen-coord polar, with 0deg=East and 90deg=South
>>>>>> C) Switch to bearing angles, with 0deg=North and 90deg=East
>>>   As an author, I vote for C.  It's consistent with other angles such as transformation rotation, where a 90deg rotation turns an element's top from "North" to "East"-- and frankly, most of us are familiar with bearing angles but don't remember polar angles from school at all.  Blame GPS devices, blame a conspiracy of cartographers if you will, but I think way more people will take naturally to C than A.
>> My GPS never talks about angles and degrees when it talks to me.
>> But all the design and editing and publishing software I've used in like the last 25 years (from Aldus, Quark, Macromedia, Adobe, etc.) has always indicated linear direction with zero pointing right and 90 pointing up. And they all, IIRC, also had zero coordinates in upper left and positive coordinates down and to left. So I completely disagree with your premise.
> Indeed, one of the strong points here is how graphics software (most of them) approach the angle, which is 0deg=East, 90deg=North. That makes the most natural setting to be the current one (A), at least to the people that also design.
> But at the same time, applications make use of handles to aid designers in choosing the direction/angle.

Yes, but the important point is that you don't have to use the handles. The numbers are just as valid a way to set the angle, and are quickly understood even by those who don't know other ways to set the direction of a gradient.

> CSS doesn't have that, only numeric values. 

Authoring applications do. Consider Adobe, which sells a lot of their software in Suites that include PhotoShop, Illustrator, InDesign, and DreamWeaver. Each of those, except DreamWeaver (the Web authoring application) have ways of setting the gradient by number, using the standard conventions. Once DreamWeaver can set gradient, shouldn't it have a similar way of doing so as the other applications of the suite, which are otherwise consistent? And wouldn't it be weird and confusing to enter 35 in the GUI and have it show up as 55 or 325 or something else in the code view?

> This means that it's going to be much more difficult for someone, who isn't a designer, to comprehend an angle interpretation chosen by graphics applications, than a designer that also codes CSS.

I disagree. I think if you asked almost anyone to hold their right arm up in a 45 degree angle, you would get pretty consistent results. I think most would just point up and to the right, without first pointing to the right or left and then rotating their arm.

> I believe that the most important fact to consider here is that other properties use clock-wise rotation (90deg = top becoming right).

If you really, really want to think about a rotation (instead of a straight direction) and want the rotation to go clockwise, then imagine a gear, turning clockwise, that is turning a same-sized circle, in which a pointer on the circle is initially pointing to the right. I say this to show that the notion of pointing in a certain direction based on common conventions is not fundamentally at odds with clockwise rotation.

> Even shorthand properties are CW.
> The current angle setting for gradients however, is based on CCW rotation

That is the thing I dispute the most. The degrees in gradients do not indicate a rotation, they indicate a linear direction. No rotation is needed in order to understand the linear direction; you only need to understand what to map the degrees to, and what we have already is by far the most common mapping for translating degrees into a single linear direction.

> , which makes it inconsistent with other properties, and makes less sense to anyone that isn't a designer.
> Even in graphics applications, rotation individually (as an action) is relative to a current position, and always works CW for positive angles.

For rotation object it is. For setting any kind of linear direction, it absolutely is not. If the current gradient angle is 90 in PhotoShop's gradient layer effect, and you change it to zero, you get a new direction (not 90 - 0, or 90 + 0).
Received on Wednesday, 18 May 2011 16:41:02 GMT

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