Question

I'm drawing a game grid with rect() and I'd like some borders of my rectangle have different colors.

exemple: I'd like a rectangle with left and right borders green but top and bottom borders blue, do you see a way ?

Thanks

Was it helpful?

Solution

You can't color rect borders differently, but you can retrace your rect with separate lines:

stroke(0,0,255);
rect(50,50,100,100);
stroke(0,255,0);
line(50,50,50,150);
line(150,50,150,150);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top