strokeWeight()
Sets the width of the stroke used for lines, points, and the border around shapes. All widths are set in units of pixels.
Using point() with strokeWeight(1) or smaller may draw nothing to the screen, depending on the graphics settings of the computer. Workarounds include drawing the point using either circle() or square().
Examples

function setup()
size(400, 400)
strokeWeight(4) -- Default
line(80, 80, 320, 80)
strokeWeight(16) -- Thicker
line(80, 160, 320, 160)
strokeWeight(40) -- Beastly
line(80, 280, 320, 280)
describe('3 lines of increasing thickness')
end
Syntax
strokeWeight(weight)
Parameters
| Parameter | |
|---|---|
| weight | Number: The weight (in pixels) of the stroke |
Related
This reference page contains content adapted from p5.js and Processing by p5.js Contributors and Processing Foundation, licensed under CC BY-NC-SA 4.0.