The stroke() function is used to draw the lines and border around the text and shapes. The color object can be set in terms of RGB or HSB depending on the color mode. The color object can also be set as string in terms of RGB, RGBA, Hex CSS color or named color string.
stroke( v1, v2, v3, alpha )
stroke( value )
stroke( gray, alpha )
stroke( values )
stroke( color )
- v1: It is used to set the red or hue value relative to current color range.
- v2: It is used to set the green or saturation value relative to current color range.
- v3: It is used to set the blue or brightness value relative to current color range.
- alpha: It is used to set the transparency of the drawing.
- value: It is used to set the value of color string.
- gray: It is used to set the gray value.
- values: It is an array containing the red, green, blue and alpha value.
- color: It is used to set the stroke color.
Below examples illustrate the stroke() function in p5.js:
- Node.js | GM stroke() Function
- CSS | stroke-width Property
- CSS | stroke-dasharray Property
- CSS | stroke-linejoin Property
- CSS | stroke-dashoffset Property
- CSS | stroke-linecap Property
- CSS | stroke-miterlimit Property
- CSS | stroke-opacity Property
- HTML | canvas stroke() Method
- How to get the function name inside a function in PHP ?
- p5.js | cos() function
- D3.js | d3.min() function
- p5.js | log() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.