<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs" -->

---
title: The Kaleidoscope Is a Mirror Trick | daily.dev
description: A canvas-based kaleidoscope demo mirrors and rotates a single pointer stroke around a ring using rotate/scale transforms, additive compositing, and a fading...
canonical: https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Kaleidoscope Is a Mirror Trick | daily.dev
og:description: A canvas-based kaleidoscope demo mirrors and rotates a single pointer stroke around a ring using rotate/scale transforms, additive compositing, and a fading...
og:url: https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs
og:image: https://api.daily.dev/og/posts/TdlVM3wxS.png
og:image:alt: The Kaleidoscope Is a Mirror Trick
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Kaleidoscope Is a Mirror Trick

**[Creative Design Technologist](https://daily.dev/sources/carmenansio)** · [@carmenansio](https://daily.dev/carmenansio) · 5 min read · 7 upvotes · 0 comments

## Summary

A canvas-based kaleidoscope demo mirrors and rotates a single pointer stroke around a ring using rotate/scale transforms, additive compositing, and a fading trail to turn one gesture into a symmetric flower. The piece walks through the math of dihedral symmetry (N rotations, N mirror lines, 2N copies), explains why additive glow needs decay to avoid bleaching to white, and argues why the effect requires canvas rather than CSS since it depends on redrawing motion over time rather than compositing static elements.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.carmenansio.com/articles/kaleidoscope-symmetry-canvas>

## Questions this post answers

### How do you create a kaleidoscope mirror effect using the canvas API?

Stamp each pointer stroke segment N times around a ring, rotating each copy by 360/N degrees and mirroring alternate copies with ctx.scale(1, -1), producing dihedral symmetry with 2N total copies. Combine this with globalCompositeOperation set to 'lighter' so overlapping strokes brighten additively, and a semi-transparent fill each frame instead of clearing, so strokes fade into a trailing glow rather than vanishing instantly.

_daily.dev surfaces canvas animation techniques like this for developers building generative visual effects._

### Why does my canvas glow effect turn completely white over time?

Using additive blending (globalCompositeOperation 'lighter') without any decay causes brightness to only ever increase, so overlapping strokes eventually clip to a solid white smear. The fix is to wash the canvas each frame with a nearly transparent fill instead of clearing it fully, which lets old strokes fade and gives the additive brightness somewhere to fall back to.

_Developers debugging canvas rendering quirks can track fixes like this decay-versus-glow balance on daily.dev._

### Can a kaleidoscope or mirror-symmetry effect be built with pure CSS instead of canvas?

Only a static version: clip-path can cut an element into a wedge and a flipped transform can place mirrored copies over a shared background. It falls apart for anything dynamic, since there is no way to mirror a live gesture, accumulate a buffer of light across frames, or apply decay, because a stylesheet composites existing boxes rather than redrawing motion, which is why a moving version requires canvas.

_Anyone deciding between CSS and canvas for a motion-driven UI effect can find comparisons like this on daily.dev._

## Similar posts on daily.dev

- [M.C. Escher Print Gallery Shader](https://daily.dev/posts/m-c-escher-print-gallery-shader-8xhmulvgt) · Hacker News · 0 upvotes · 0 comments
- [Exploring 3D Image Rotations on Scroll](https://daily.dev/posts/exploring-3d-image-rotations-on-scroll-e05yzexmt) · Codrops · 0 upvotes · 0 comments
- [Making art with CSS gradients and corner-shape and skew, oh my](https://daily.dev/posts/making-art-with-css-gradients-and-corner-shape-and-skew-oh-my-mswlzgmp1) · Cassidy's blog · 40 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#css](https://daily.dev/tags/css), [#creative-coding](https://daily.dev/tags/creative-coding)

[View this post on daily.dev](https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Kaleidoscope Is a Mirror Trick","url":"https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs"},"datePublished":"2026-09-13T21:04:33.558Z","dateModified":"2026-09-14T18:00:17.787Z","description":"A canvas-based kaleidoscope demo mirrors and rotates a single pointer stroke around a ring using rotate/scale transforms, additive compositing, and a fading...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8380331d527910c9e098a1426f6c72ac?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8380331d527910c9e098a1426f6c72ac?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Creative Design Technologist","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Carmen Ansio","url":"https://daily.dev/carmenansio","image":"https://media.daily.dev/image/upload/s--Sl7WLCAs--/f_auto/v1723634130/avatars/avatar_3IJIxchf5","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":100}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,css,creative-coding","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Creative Design Technologist","item":"https://daily.dev/sources/carmenansio"},{"@type":"ListItem","position":3,"name":"The Kaleidoscope Is a Mirror Trick"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-kaleidoscope-is-a-mirror-trick-tdlvm3wxs#faq","mainEntity":[{"@type":"Question","name":"How do you create a kaleidoscope mirror effect using the canvas API?","acceptedAnswer":{"@type":"Answer","text":"Stamp each pointer stroke segment N times around a ring, rotating each copy by 360/N degrees and mirroring alternate copies with ctx.scale(1, -1), producing dihedral symmetry with 2N total copies. Combine this with globalCompositeOperation set to 'lighter' so overlapping strokes brighten additively, and a semi-transparent fill each frame instead of clearing, so strokes fade into a trailing glow rather than vanishing instantly. daily.dev surfaces canvas animation techniques like this for developers building generative visual effects."}},{"@type":"Question","name":"Why does my canvas glow effect turn completely white over time?","acceptedAnswer":{"@type":"Answer","text":"Using additive blending (globalCompositeOperation 'lighter') without any decay causes brightness to only ever increase, so overlapping strokes eventually clip to a solid white smear. The fix is to wash the canvas each frame with a nearly transparent fill instead of clearing it fully, which lets old strokes fade and gives the additive brightness somewhere to fall back to. Developers debugging canvas rendering quirks can track fixes like this decay-versus-glow balance on daily.dev."}},{"@type":"Question","name":"Can a kaleidoscope or mirror-symmetry effect be built with pure CSS instead of canvas?","acceptedAnswer":{"@type":"Answer","text":"Only a static version: clip-path can cut an element into a wedge and a flipped transform can place mirrored copies over a shared background. It falls apart for anything dynamic, since there is no way to mirror a live gesture, accumulate a buffer of light across frames, or apply decay, because a stylesheet composites existing boxes rather than redrawing motion, which is why a moving version requires canvas. Anyone deciding between CSS and canvas for a motion-driven UI effect can find comparisons like this on daily.dev."}}]}
```

