Thursday, September 4, 2025
HomeLanguagesJavascriptp5.js noStroke() Function

p5.js noStroke() Function

The noStroke() function is an inbuilt function in p5.js which is used to remove the outline which is used to draw lines and borders around shapes. By default, black color stroke is set to shapes.

Syntax:

noStroke()

Parameters: This function does not accepts any parameter.

Below program illustrates the noStroke() function in P5.js:
Program:




function setup() {
  
    // Canvas size 400*400
    createCanvas(400, 400); 
}
  
function draw() {
  
    // Shape defined just below, will not have any outline
    noStroke(); 
  
    // Fill light-green color to shape
    fill('lightgreen'); 
    rect(20, 20, 160, 160);
}


Output:

Reference: https://p5js.org/reference/#/p5/noStroke

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6632 POSTS0 COMMENTS
Nicole Veronica
11800 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11860 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS