Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Colored Mandelbrot with P5.js

Public visualization

Colored Mandelbrot with P5.js

2 stars0🌍 Public
CCurran Kelleher
Last edited Jan 31, 2024
Created on Jan 31, 2024

This example renders an interactive Mandelbrot set fractal using the p5.js library, with a custom color palette applied to the escape-time values. The visualization iterates over every pixel in the canvas, mapping coordinates to the complex plane and testing how quickly each point diverges under the z = z² + c formula. Instead of grayscale, the code assigns vibrant RGB values derived from the iteration count, producing psychedelic gradients within the fractal’s basin. It uses p5’s `loadPixels`, `updatePixels`, and `map` functions to manipulate the pixel array directly.

AI-generated description

The P5JS example: Mandelbrot Set.

Modified to make some fancy colors!

Comments

Sign in to join the discussion.

MIT Licensed