Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change color of all circles?? #7035

Closed
yealicjswo opened this issue May 13, 2024 · 2 comments
Closed

How to change color of all circles?? #7035

yealicjswo opened this issue May 13, 2024 · 2 comments

Comments

@yealicjswo
Copy link

Topic

I would like to add color(any color I want) of whole dot while I test with 'for' loops example.
so, Is there an any solution for applying color of all circles??

function setup() {
createCanvas(600, 600);
}

function draw() {
background(240);
let space = 10;
strokeWeight(4);

for (let x = space; x < 600; x += space) {
// Loop from the top to the bottom.
for (let y = space; y < 600; y += space) {
point(x, y);
}
}
}

Screen Shot 2024-05-13 at 5 16 28 PM
@yealicjswo yealicjswo changed the title How to add color of whole dots?? How to add color of whole dot?? May 13, 2024
@yealicjswo yealicjswo changed the title How to add color of whole dot?? How to add color of all circles?? May 13, 2024
@yealicjswo yealicjswo changed the title How to add color of all circles?? How to change color of all circles?? May 13, 2024
@limzykenneth
Copy link
Member

Hi @yealicjswo you can use the stroke() function like the below:

function setup() {
  createCanvas(600, 600);
}

function draw() {
  background(240);
  let space = 10;
  strokeWeight(4);
  stroke(255, 0, 0);

  for (let x = space; x < 600; x += space) {
    // Loop from the top to the bottom.
    for (let y = space; y < 600; y += space) {
      point(x, y);
    }
  }
}

If you need help with your own code, please direct your questions to the forum or Discord. We use GitHub issues mainly for bug reports and feature requests only. Thanks!

@yealicjswo
Copy link
Author

@limzykenneth thanks! I will make sure to ask an question(for my own code) in the forum and Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants