
The elastic button
Buttons, Hover, Text
A design tool’s palette check in a card on white: five colours and four ways of seeing them, normal vision, protanopia, deuteranopia and tritanopia. Picking a kind of colour blindness fades the colours into the ones seen by people who have it, and under the two that end up looking alike a bracket is drawn joining them; at the top the count of the pairs that get confused, below their names.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Color blindness simulator" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Color blindness simulator</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the colour-vision check of a design tool: a palette seen with protanopia, deuteranopia or tritanopia,
and the colours that end up looking alike joined by a bracket -->
<section class="cv" data-cv aria-label="Palette check">
<header class="cv__head"><strong>Palette check</strong><span class="cv__sum"><span data-outsum>All distinct</span></span></header>
<div class="cv__seg" role="group" aria-label="Colour vision" data-seg>
<i class="cv__pick" data-pick aria-hidden="true"></i>
<button type="button" class="cv__opt" data-kind="normal"><span>Normal</span></button>
<button type="button" class="cv__opt" data-kind="protan"><span>Protan</span></button>
<button type="button" class="cv__opt" data-kind="deutan"><span>Deutan</span></button>
<button type="button" class="cv__opt" data-kind="tritan"><span>Tritan</span></button>
</div>
<div class="cv__view">
<div class="cv__row" data-row></div>
<svg class="cv__links" data-links aria-hidden="true"></svg>
<div class="cv__names" data-names></div>
</div>
<p class="cv__note"><span class="cv__clip cv__what"><span data-outwhat>Full colour vision</span></span><span class="cv__clip cv__said"><span data-outsaid>Every colour stays apart.</span></span></p>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></svg>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
23 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Color blindness simulator” from Animorio and fit it into my siteEvery colour is taken to linear RGB, multiplied by the matrix of the kind of colour blindness (those of Machado, Oliveira and Fernandes, 2009) and brought back to sRGB. Three matrices, one per kind.
Every swatch keeps its starting colour and its target; a single number goes from zero to one and each swatch reads it with a small delay.
The distance between every pair of simulated colours is measured in Lab space: under the threshold the pair counts as confusable.
For every pair an SVG path goes down from the middle of one swatch, runs underneath and comes up at the middle of the other, drawn with stroke-dashoffset. A second pair runs lower.
| Name | File | Default | What it changes |
|---|---|---|---|
RED | script.js | #d9432f | The first colour of the palette. |
GREEN | script.js | #5f9a2a | The second colour. |
BLUE | script.js | #2f6fe0 | The third colour. |
AMBER | script.js | #e8a317 | The fourth colour. |
VIOLET | script.js | #8a4fd8 | The fifth colour. |
ALIKE | script.js | 24 | Under which distance two colours count as confusable. |
FADE | script.js | 0.6 | How many seconds the colours take to change. |
SPRING | script.js | 1 | How much the tile and the confused colours bounce. |
LOOP | script.js | true | Left alone, the demo’s pointer tries the three kinds of colour blindness and starts again. |
In the colour editor of a design system, in the panel of a palette generator or in a dashboard’s chart settings, to see at once whether two series get confused; the same segmented control transforming a preview carries an interface’s themes, a photo’s lighting conditions or the versions of a brand.
The card is at most 348 pixels wide and about 270 tall, and narrows with the screen: the five swatches share the width and the brackets are redrawn on their centres. The four options are 32 pixels tall.
No fades and no hops: the simulated colours, the brackets already drawn and the new texts appear at once. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.5 KB; the libraries: GSAP 28 KB.
Tested on 30 November 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.