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
- HTML | canvas stroke() Method
- CSS | stroke-width Property
- CSS | stroke-linecap Property
- CSS | stroke-opacity Property
- CSS | stroke-dashoffset Property
- CSS | stroke-dasharray Property
- CSS | stroke-linejoin Property
- CSS | stroke-miterlimit Property
- Fabric.js | Text stroke Property
- How to add stroke width of text canvas using Fabric.js ?
- Fabric.js | Circle stroke Property
- How to set stroke width of a canvas circle using Fabric.js ?
- Fabric.js | Rect stroke Property
- Fabric.js | Triangle stroke Property
- Fabric.js | Ellipse stroke Property
- SVG Stroke Properties
- Fabric.js Polyline stroke Property
- CSS stroke-color property
- SVG stroke-width Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.