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

Re: [css3-images] Gradient Magic

From: Behnam Esfahbod ZWNJ <behnam@zwnj.org>
Date: Fri, 22 Jul 2011 01:36:46 -0400
Message-ID: <CAPTpOH+Nfkh+9dt+nNNKT2mz5YEp_pb7O22Axg2YhmJk4ozTHg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Alexander Shpack <shadowkin@gmail.com>, WWW-Style <www-style@w3.org>
You are Tab. Actually it was kind of obvious that Alexander's mesh
would work as he expected, because the middle of the box should have
the color (A+B+C+D)/4 which definitely wouldn't be equal to white in
this case.

-Behnam


On Thu, Jul 21, 2011 at 9:10 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Jul 19, 2011 at 2:15 PM, Alexander Shpack <shadowkin@gmail.com> wrote:
>> On Sat, Jul 16, 2011 at 11:10 PM, Behnam Esfahbod ZWNJ <behnam@zwnj.org> wrote:
>>> Hi,
>>>
>>> Implementing the CSS3 Linear Gradient for another application, I
>>> noticed one very useful gradient style is almost undoable using the
>>> latest syntax. This style is when you want gradient colors from A to B
>>> to C, with A on the bottom-right, C on the top-left, and B on the
>>> top-right and bottom-left. (In the attached screenshot, A = red, B =
>>> white, and C = blue.) This
>>
>> IMHO, this is not a part of Linear Gradient, it should be Gradient Mesh
>>
>> background-image: gradient-mesh(
>> /* A point */    0 0 red,
>> /* B point */    right top white,
>> /* C point */    0 100% red,
>> /* D point */    left bottom white
>> );
>>
>> Then, authors may create any gradients
>
> After two days of teaching myself the basics of computer graphics and
> mesh gradients, then putting it all together into a canvas-based mesh
> gradient draw-er, I can confidently state that you're wrong.  It would
> take *two* mesh gradients to duplicate image.  ^_^
>
> (It wasn't wasted time - I've had a lot of fun being frustrated by
> graphics math.)
>
> ~TJ
>



-- 
    '     بهنام اسفهبد
    '     Behnam Esfahbod
   '
  *  ..   http://behnam.esfahbod.info
 *  `  *  http://zwnj.org
  * o *   3E7F B4B6 6F4C A8AB 9BB9 7520 5701 CA40 259E 0F8B
Received on Friday, 22 July 2011 05:37:43 GMT

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