q5play
    Preparing search index...

    Function vertex

    • 🖌 Specifies a vertex in a shape.

      Each vertex can have its own fill color. Useful for creating gradients.

      Parameters

      • x: number

        x-coordinate

      • y: number

        y-coordinate

      Returns void

      await Canvas(200);

      stroke(1, 0.5);
      strokeWeight(20);

      beginShape();
      fill(1, 0, 0);
      vertex(-80, -80);
      vertex(40, -60);
      fill(0, 0, 1);
      vertex(80, 60);
      vertex(-60, 80);
      endShape(true);