I have drawn a line with: ```val line = graphics {...
# korge
r
I have drawn a line with:
Copy code
val line = graphics {
        stroke(
            ColorPaint(Colors.LIGHTGRAY),
            Context2d.StrokeInfo(thickness = 1.0)
        ) {
            moveTo(e1.v1.pos.x + VERTEX_RADIUS, e1.v1.pos.y + VERTEX_RADIUS)
            lineTo(e1.v2.pos.x + VERTEX_RADIUS, e1.v2.pos.y + VERTEX_RADIUS)
        }
Is it possible to change the color of this line afterwards? If not, what should I use to draw the line instead?
d
There is a single line?
youcan draw it white, then use tinting
if not, you should redraw it
r
I want to change the color when certain state changes. What do you mean with redraw?
d
message has been deleted
here the tinting way
message has been deleted
repainting the shape
r
Ah, thnx. I will play with this
d
­čĹŹ
tinting is orders of magnitude faster
super cheap
repainting is costly
so take that in mind