re x design choice for color handling question in article lu oftinnnfk cascais cs utexas edu sirosh cs utexas edu joseph sirosh writes most graphics systems i have seen have drawing routines that also specify a color for drawing like drawpoint x y color or drawline x y x y color or fillrectangle x y x y color with x i have to do something like xsetforeground current color xdrawpoint d w x y why split this into two functions why did x designers decide to not associate the color with the object being drawn and instead associate it with the display it is being drawn on for flexibility anyway what you say is not really true the color information is associated with a graphicscontext not with a display and the gc is a parameter to the drawing routines so if you need to fast switch between green dotted lines and blue ones of width you can make gcs for those cases and then simply do xdrawline dpy win gc red x y x y xdrawline dpy win gc blue x y x y for this effect this is eventually more complicated to do for the programmer but also much more efficient and flexible you would not include all the other parameters like line pattern with cap and joinstyle drawmode and so on in every drawing call so why do it for color btw stay away from xdrawpoint if you don t really need it to draw random points for image transfers there are image routines o o o brain inside o o o o andre beck abpsoft mehl andre beck irs inf tu dresden de o o o
