1
This example creates a chocolate donut with colorful sprinkles using the Canvas API. The code draws two concentric circles to form the donut shape, filling the outer ring with a brown color and the center with a neutral background tone. It then generates 30 random sprinkles positioned within the donut ring, using trigonometric functions to place them at varied angles and distances from the center. Each sprinkle is rendered as a small circle with a randomly chosen color from a predefined palette. The result is a simple, static data-free visualization that demonstrates procedural drawing and randomness.