Loading

Pstroke

processing

Sets the color used to draw lines and borders around shapes. This color is either specified in terms of the RGB or HSB color depending on the current colorMode The default color space is RGB, with each value in the range from 0 to 255.

The most efficient is to use the raw ARGB format: 0x102030FF means Red 32, Green 48, Blue 255 with alpha=16/255. Alpha 0xFF means fully opaque. When using v1, v2, v3, gray, alpha, Pstroke calls internally Pcolor.

The value for the gray parameter must be less than or equal to the current maximum value as specified by PcolorMode. The default maximum value is 255.

Link to original Processing doc

Pstroke is available since version 1.0.0.

See also

Signatures

Examples

// @preview image 300 200 '2D' PGraphics //new image instance, 300x200 pixels 0xffffff6c Pbackground //yellow background 3 PstrokeWeight //stroke width 3pixels 0xff0000ff Pstroke //blue stroke (ARGB color) 0x7fff0000 Pfill //semi transparent red fill 10 50 40 100 Prect //draw a rectangle, left corner 10 30, size 100 50 120 Pstroke //grey 180 Pfill //darker grey 60 50 40 100 Prect //draw a rectangle, left corner 10 30, size 100 50 120 50 Pstroke //grey nearly transparent 180 50 Pfill //darker nearly transparent 110 50 40 100 Prect //draw a rectangle, left corner 10 30, size 100 50 //here you can see that the stroke is drawn over the fill. 8 PstrokeWeight 0 0 255 120 Pstroke //red nearly transparent 255 Pfill //white 160 50 40 100 Prect //draw a rectangle, left corner 10 30, size 100 50 255 0 0 40 Pstroke //red nearly transparent 255 0 0 127 Pfill //red transparent 210 50 40 100 Prect //draw a rectangle, left corner 10 30, size 100 50 Pencode //render the image in a base64 format on the stack