# To subscribers of the xforms list from "T.C. Zhao" <tc_zhao@yahoo.com> :
You have to use a different index for different colors.
fl_mapcolor() always deallocates the old color first
before getting a new color. Depending on what's
happening on the system in the X front, the new
pixel value may be the same as the old one, thus
when redraw occurs, you'll find old drawing
changes color.
--- Nicolas Castagne <Nicolas.Castagne@imag.fr> wrote:
> # To subscribers of the xforms list from Nicolas Castagne
> <Nicolas.Castagne@imag.fr> :
>
> Hi,
>
> I need draw many different circles with different colors on a form
> (but
> not in a free object).... and i have problems with colors.
>
> To draw these circles, i use a FL_FREE_COL and process that way :
>
> fl_mapcolor(FL_FREE_COL1, r1,g1,b1)
> fl circf(position1, size1..., FL_FREE_COL1)
> /*draw the first circle*/
>
> fl_mapcolor(FL_FREE_COL1, r2,g2,b2)
> fl circf(position2, size2..., FL_FREE_COL1)
> /*draw the first circle*/
>
> ..... etc....
>
> I use only one of the FREE_COL because I have to draw many circles...
>
> It is usually OK, but sometimes a strange behavior happens :
> some of the circles are redrawn with one of the r,g,b values I used
> (not
> always the same of course :) ), so that they have the same color...
>
> Sometimes the circles seem to behave like usual XFORMS objects
> (boxes,
> buttons...), and are drawn with the curent rgb values of the FL_COLOR
> they
> were drawn with, sometimes they keep the rgb values used when the
> fl_circf
> was called - which is much more interesting for me...
>
> How could I draw using a large variety of colors ? Do I need to use a
> gl_canvas object ?
>
> Thanks
>
> Nicolas
>
> --------------------------------------------------------------------
> Nicolas Castagne
> ACROE (Association pour la creation et la recherche sur les outils
> d'expression)
> INPG, Grenoble.
>
> tel : 04 76 57 43 39
> --------------------------------------------------------------------
>
>
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuhs.mil or see
> http://bob.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://world.std.com/~xforms
> List Archive: http://bob.usuhs.mil/mailserv/list-archives/
>
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Sun May 28 2000 - 11:51:29 EDT