Skip to main content
100%

Sierpinsy Triangle

✓ Published0🌍 Public
CCurran Kelleher
Last edited Aug 2, 2025
Created on Aug 1, 2025
Forked from HTML Starter

This example renders a colorful Sierpinski triangle fractal using the HTML5 Canvas API. The visualization recursively draws the triangle to a depth of five, with each smaller triangle assigned a random bright hue via the `hsl()` color function. It uses basic Canvas drawing methods like `moveTo`, `lineTo`, and `fill`, and the display automatically resizes with the window.

AI-generated description

Sierpinski Triangle

A fractal rendering of the Sierpinski triangle using HTML5 Canvas.

The triangle is drawn recursively with a depth of 5. Each smaller triangle is colored randomly with a bright hue.

The canvas resizes automatically when the window is resized.

MIT Licensed

Similar vizzes