[Image-SIG] Palette fill on lines?

Deirdre Saoirse Moen deirdre@deirdre.net
Mon, 13 May 2002 13:19:40 -0700


At 1:01 PM -0700 5/13/02, Deirdre Saoirse Moen wrote:
>At 2:37 PM -0500 5/13/02, Richard A. Smith wrote:
>>On Mon, 13 May 2002 11:53:35 -0700, Deirdre Saoirse Moen wrote:
>>
>>>So, at the risk of sounding like a complete dolt, how do I specify a
>>>colored line? Trying an RGB tuple didn't work for the fill parameter,
>>>for example. setink on the prior line is soundly ignored.
>>
>>fill = (R,G,B) as an argument in the draw.line() method worked for
>>me.  I'm using 1.1.2 though.
>
>I'm using 1.1.3

To answer my own question, this works:

  lg.d.setink(4)
  lg.d.setfill(0)
  for i in xrange(0, len(lg.hits) - 1):
    # we have the x for each value, so draw lines
   lg.d.line((lg.xpoints[i], convertToY(lg, lg.hits[i]))          
        + (lg.xpoints[i+1], convertToY(lg, lg.hits[i+1])))


For small values of "works" -- the first segment is yellow rather than blue.

I think it's completely broken behavior that the ink color works only 
when the fill isn't set, but that's how the code is written.
-- 
_Deirdre    Stash-o-Matic: http://fuzzyorange.com    http://deirdre.net
"I'm writing a book. I've got the page numbers done."   - Steven Wright