noStroke()
Category:Drawing
Disables the stroke used for lines, points, and the border around shapes. Restore the stroke by using the stroke()
command. For shapes, if both noStroke()
and noFill()
are run, nothing will be drawn to the screen.
Examples
// Turn off the stroke and then back on again. Note the strokeWeight is maintained throughout.
rect(100, 100, 200, 200);
strokeWeight(10);
point(150, 150);
line(125, 250, 150, 250);
noStroke();
point(175, 150);
stroke("red");
line(175, 250, 200, 250);
Syntax
noStroke()
Returns
No return value. Changes future output to the display only.
Found a bug in the documentation? Let us know at support@code.org.