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

RE: [css3-images] Gradients feedback

From: Brian Manthos <brianman@microsoft.com>
Date: Fri, 10 Sep 2010 20:17:08 +0000
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Simon Fraser <smfr@me.com>
CC: www-style list <www-style@w3.org>
Message-ID: <FA122FEC823D524CB516E4E0374D9DCF0FCE46CD@TK5EX14MBXC132.redmond.corp.microsoft.com>
Boris Zbarsky wrote:
> Agreed.  Note that SVG colors always have alpha == 1, so you can't have a
> gradient with non-opaque colors or stops in SVG.  So no matter what we do
> here it'll be consistent with SVG as it stands now.

I found this assertion surprising.

Opera, Safari, and IE9 PPB4 consider rgba acceptable for stop colors.  Firefox seems to agree with Boris, rejecting rgba in stop colors.

-Brian


<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 800" version="1.1"
     xmlns="http://www.w3.org/2000/svg">
  <desc>Example lingrad01 - fill a rectangle using a 
           linear gradient paint server</desc>
  <g>
    <defs>
      <linearGradient id="MyGradient1">
        <stop offset="5%" stop-color="rgb(255,0,0)" />
        <stop offset="95%" stop-color="rgb(0,0,255)" />
      </linearGradient>
      <linearGradient id="MyGradient2">
        <stop offset="5%" stop-color="rgba(255,0,0,0.5)" />
        <stop offset="95%" stop-color="rgba(0,0,255,0.1)" />
      </linearGradient>
    </defs>

    <!-- Outline the drawing area in blue -->
    <rect fill="none" stroke="blue" 
          x="1" y="1" width="798" height="798"/>

    <!-- The rectangle is filled using a linear gradient paint server -->
    <rect fill="url(#MyGradient1)" stroke="black" stroke-width="5"  
          x="100" y="100" width="600" height="200"/>
    <rect fill="url(#MyGradient2)" stroke="black" stroke-width="5"  
          x="100" y="400" width="600" height="200"/>
  </g>
</svg>
Received on Friday, 10 September 2010 20:17:48 GMT

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