Re: howto fill a divided figure?

Hi Jonathan.

Jonathan Chetwynd:
> draw a figure, let's say a rectangle.
> divide it, let's say bisect it.
> now fill the 2 halves with complementary colours.
> 
> seems simple, but is it?

Sure it is.

  <linearGradient id="g1" x1="0" y1="0" x2="0" y2="100%">
    <stop color="red" stop-offset="0%"/>
    <stop color="red" stop-offset="50%"/>
    <stop color="blue" stop-offset="50%"/>
    <stop color="blue" stop-offset="100%"/>
  </linearGradient>

  <rect x="10" y="10" width="100" height="50" fill="url(#g1)"
        stroke="black" stroke-width="3"/>

Ok, so it may not be immediately obvious that you could use a gradient
for this, but it's possible.  Otherwise, just use paths.

Cameron

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922

Received on Tuesday, 31 August 2004 08:51:00 UTC