Build a Draggable Color Harmony Wheel With Live UI Preview in One HTML File

A ready-to-paste prompt that builds a draggable canvas color wheel. It plots complementary, triadic and analogous schemes live and previews each one on a mini website mockup.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a senior front-end developer and UI designer who builds polished color tools. Build Harmony Compass, a single-page color harmony wheel that plots complementary, triadic and analogous schemes live and previews them on a mini UI mockup instead of abstract dots. Draw an HSL wheel on a canvas, with hue around the circle, saturation from center to edge and red at the top. The user drags a base handle anywhere on the wheel, and the other harmony points follow it, joined by white spokes and an outline. Rules:
1. Controls: pointer drag for mouse and touch. When the wheel has focus, left and right arrows rotate hue, Shift gives bigger steps, and up and down change saturation. Add a lightness slider and three mode buttons using aria-pressed.
2. Show a swatch card per color with role name, HEX and HSL. Pick white or dark text by WCAG contrast.
3. Mockup: a fictional workshop studio homepage with a nav bar, badge, headline, primary and ghost buttons, and three small cards including a mini bar chart. Color it all from the scheme through CSS variables, and report the button text contrast ratio with an AA verdict.
4. Layout: two columns on wide screens, stacked under 860px, fitting 360-1280px. The canvas redraws crisply on resize using devicePixelRatio.
5. Calm neutral chrome, system fonts, a clear type scale. Use short color transitions and turn them off under prefers-reduced-motion.
6. No external libraries, fonts, storage or network calls.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Harmony Compass, a draggable color wheel with a live website preview.

Drag anywhere on the wheel to move the base color. The complementary, triadic or analogous points follow it instantly. Switch modes with the pill buttons and use the slider to lighten or darken the whole wheel. Swatch cards list HEX and HSL values. The Fernhouse Studio mockup recolors live and reports whether its button text passes WCAG AA. Try a pale lightness to see contrast fail.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • It pins down the wheel geometry (red at top, saturation by radius), so the handle math and the drawn wheel always match.
  • Coloring the mockup through CSS variables makes every scheme change instant and keeps the preview code tiny.
  • Picking text color with a WCAG contrast check keeps swatches and buttons readable in any scheme.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as harmony-compass.html and open it in any browser, or run it in the chat's preview or canvas panel.

Common edits

  • Add split-complementary, tetradic or monochrome modes by adding hue offsets to the harmony list.
  • Swap the workshop mockup for a dashboard, mobile app screen or poster that matches your project.

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Keep exploring

More in Design