This demonstrates a radial gradient based on two points, but where it picks one color or the other without mixing between them. It runs in a full-screen filter shader.
Dithered Gradient (p5.strands): Created by Dave Pagurek. From 2026 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: Code. You can suggest improvements by contributing to the current website!
Ejemplos Relacionados

No alt text
Filtro de sombreado (p5.strands)
Manipula imágenes con un filtro de sombreador (shader).

No alt text
Filtro de sombreado (GLSL)
Manipula imágenes con un filtro de sombreador (shader).

No alt text
Ajusta Posiciones con un Sombreador (p5.strands)
Usar un sombreador para ajustar los vértices de una forma.

No alt text
Ajusta Posiciones con un Sombreador (GLSL)
Usar un sombreador para ajustar los vértices de una forma.

No alt text
Desenfoque del búfer de trama (framebuffer)
Simular la profundidad de campo de una cámara.

A gradient from red to blue.
Gradient (p5.strands)
Draw a radial gradient between two points in p5.strands.

A dithered gradient from red to blue.
Dithered Gradient (p5.strands)
Draw a dithered radial gradient between two points in p5.strands.

A row of five orange spheres. The closest and farthest spheres from the camera appear blurred.
Depth Blur (p5.strands)
Simulate a camera's depth of field, with a shader written in p5.strands.

A city scene blurred around the edges of the frame
Variable Blur (p5.strands)
Create a blur shader with a different amount of blur at different parts of the canvas.