W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: [css3-background] border-radius color transitions using gradients recommended but undefined

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Tue, 26 Jan 2010 19:38:05 -0800
Message-ID: <4B5FB51D.2050702@terrainformatica.com>
To: Zack Weinberg <zweinberg@mozilla.com>
CC: "www-style@w3.org" <www-style@w3.org>, Brian Manthos <brianman@microsoft.com>
Zack Weinberg wrote:
> Andrew Fedoniouk <news@terrainformatica.com> wrote:
>> There are actually not too many alternatives.
>>
>> The most viable solution is to a) use conic gradient 
> 
> How are you drawing the conic gradients?  I've not been able to find
> them as an accelerated primitive on any common OS.

Sciter and HTMLayout (h-smile core) are using AGG [1] for such things.
So that part is implemented in code generating such bitmaps.

In any case I don't think that HW acceleration is viable for all border 
coupling combinations in CSS.

> 
>> Using method (B):
>> http://www.terrainformatica.com/w3/round-corners-sciter-b.png
>>
>> And for the record the same but using method (A) on the figure above:
>> http://www.terrainformatica.com/w3/round-corners-sciter.png
>>
>> Note case #10. (B) variant I think is least controversial.
> 
> I don't think either of the options you have presented is the correct
> rendering for case #10.  I think that when the inner edge has a sharp
> corner, the point of the cone should always be at the corner, even when
> that's not a corner of the outer bounding box of the transition area.
> And I think the gradient should probably be limited to the dark green
> region in "case D" here:
> 
> http://dev.w3.org/csswg/css3-background/transition-region.png
> 
> but I might be persuaded that it should extend to the limits of the
> light green region with the point of the cone remaining at the inner
> corner (i.e. equivalent to your current case 10 rendering but with the
> point of the cone moved). Is it practical for you to redraw your "case
> 10" under both of those rules and post the result?
> 

Actually we are here to find out correct solutions. I think that my 
implementation is the correct one.

(D) case on your image require non-trivial gradient function.
Angle of that dark green sector will not be of 90deg and color
spread function is not a linear interpolation of end points.
That reduces optimization options to nothing. E.g. in my case
it is possible to pre-compute map once and to use it for all border
transitions no matter what color they will have.


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Wednesday, 27 January 2010 03:38:31 GMT

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