Notifications
Clear all

[Closed] gw.setColor not working?

Im trying to draw a gw.polyline in a certain color, but no matter what I do it always draws as blue (which is weird, seeing as the docs claim the default gw color is red :/)

		fn GW_DisplaySidesInteger = (
			gw.setTransform this.tm
			gw.polyline #([0,0,0], [1,0,0], [1,1,0]) false rgb:#(red, green, blue)
			gw.setColor #line (color 0 255 0)
			gw.updateScreen()
		),

edit: looks like the line is gray now when its being drawn while a mousetool is active… I suppose its better than the blue that hurts my eyes.

4 Replies

move the setcolor above the polyline line call ? you may also need to make a call to setrndlimits to get the vertex colors to work in the polyline routine

Yep, moving the setcolor one line up did the trick…
weird, but who am i to complain

this is not weird.
you can specify a color which will be used for next gw drawing (#line, #fill, #text, #clear). if you not set a color the default one will be used

it gives you a way to draw (for example lines) with different colors during one set of drawing

oh yeah no it makes perfect sense, what was weird was that I didnt realize it myself