Rotate two colors (新手請教各位大大教如何寫代碼不甚感激)

float x, y;

void setup() {
  size(800, 600);
  strokeWeight(10);
}

void draw() {
  //background(#68CEF5);
  fill(0, 15);
  rect(-50, -50, width + 100, height + 100);
  translate(width/2, height/2);
  rotate(-frameCount/80.0);


  for (int i = 0; i < width; i = i+20) {
    line(i, -i+20, i, i+20);
    rotate(PI/2);

    stroke(#68CEF5);
    point(x, y);
    stroke(255);
    point(-x, -y);
  }
}

I would like to ask you all.
If I want to use 2 colors and then rotate like him, how can I write instructions?
Please greatly guide

1 Like

If you wanted to know how to change the Color, you can do so by either using the stroke() or fill() methods depending on what you want to Color. But you should try to be consistent within your Sketch, or at least within one method. And please remember, the General Language of this Forum is english and it is suggested to write in this Language, since Most will look for answers in english and Same goes for People who can answer the questions only if they‘re in english.

1 Like

Ok, thank you for your explanation.