A kaleidoscope is an optical instrument with two or more reflecting surfaces tilted to each other at an angle. Using the translate(), rotate(), and scale() functions, you can replicate the resulting visual of a kaleidoscope in a canvas.
Related Examples
![](/_astro/07_Repetition-00_Color_Interpolation-thumbnail.CzYZT7-x_Z1kr8jn.webp)
No alt text
Color Interpolation
Fade between two colors.
![](/_astro/07_Repetition-01_Color_Wheel-thumbnail.C1vaRdoo_oYWFG.webp)
No alt text
Color Wheel
Create a visualization of the color spectrum.
![](/_astro/07_Repetition-02_Bezier-thumbnail.m5db6zrJ_ZLgvaX.webp)
No alt text
Bezier
Draw a set of curves.
![](/_astro/07_Repetition-03_Kaleidoscope-thumbnail.CF8DsOxl_Z4ylbs.webp)
No alt text
Kaleidoscope
Draw mirrored designs with the mouse.
![](/_astro/07_Repetition-04_Noise-thumbnail.DJeuUrfx_Z1KcWwv.webp)
No alt text
Noise
Generate naturalistic textures using Perlin noise.
![](/_astro/07_Repetition-05_Recursive_Tree-thumbnail.Bt-xw9xq_Z2g2AbQ.webp)
No alt text
Recursive Tree
Draw a tree using a function that calls itself.