[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Color in EW



Well, I looked a bit, made a small change, and was able to draw a color polygon,
but didn't go any farther than that.

That was a couple weeks ago.. let's see if I remember the changes--
in graphics-primitives.lisp, most of the graphics functions contain a 

	      (xlib:with-gcontext (gcontext :FUNCTION (draw-alu alu)
					    :LINE-WIDTH thickness
				   ...
					))
wrapper around the xlib: graphics functions; I did the most simple thing and
just added a 				    
					    :COLOR color
line, and passed in a pixel value.
I witnessed an actual color polygon on my screen.

The color slot should also be added to the base presentation types, if you
want to see them redisplayed.


> 	What I would really like to be able to do is mix my
> own color ALU's like I can do on my Symbolics.  Is this too 
> ambitious?  Has anyone else got anything to draw in color under
> EW?

Yes.  The correct thing to do would probably be to define a (make-color r g b)
function, and pass this as an argument in for color.  These would have to be
allocated entries in the color map, and then decoded to pixel values for use
in the gcontext.  This would give you access to the full range of colors available.

I'm not sure what the Symbolics gives you for color.  Volume 7B shows
keywords for the eight rgb, cym & b/w colors.  It should be simple to map
keywords into the appropriate pixel value, like :black -> 1, etc, like
the function DRAW-ALU does in x-interface.lisp.

The mapping should also allow straight pixel values to be passed in
unchanged, for people who like to hack color maps themselves.


I was the person who originally asked about color.  I have a color monitor
now, but only temporarily in order to make a whizzy demo, then it goes away.
If I had had more time I think I might have tried implementing the color, but
instead I'm using CLIM now, only for the color.  It's still not as "mature"
as EW (yet) in many ways, but sufficient for this one-shot job.  If and when
time allows, I'd like to work on it.


Okay, there's even more explicit directions for adding color.. 
 who's going to implement?

   Todd Kaufmann
   Center for Machine Translation
   CMU     412/ 268-7130