Este expande el ejemplo de Primitivas de Formas añadiendo color. background() llena el lienzo con un color, stroke() establece el color para dibujar líneas, y fill() establece el color para el interior de las formas. noStroke() y noFill() apagan el color de línea y el color interior, respectivamente.
Los colores pueden ser representados de muchas formas diferentes. Este ejemplo demuestra varias opciones.
Color: Created by Caleb Foss, Darren Kessner. From 2024 onwards, edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: 2023 code. You can suggest improvements by contributing to the current website!