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
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
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
Did this prompt work?
Keep exploring
More like this
Build a Color Blindness Simulator That Previews a Palette on a Dashboard Card
A single HTML file that redraws a realistic dashboard card under protanopia, deuteranopia, tritanopia and grayscale and flags color pairs that become hard to tell apart.
Build a Drag-to-Arrange Brand Mood Board with Color, Texture and Type Tiles
A prompt that produces a single HTML mood board of color, texture and type tiles built from CSS and SVG, rearrangeable by mouse, touch and keyboard.
Build a Live Accessible Color Palette Builder with a WCAG Contrast Matrix
Get a single HTML palette builder that tests every text-on-background pair, shows AA/AAA badges live, and suggests the nearest passing shade for failures.
Build an OKLCH Tint and Shade Scale Generator in a Single HTML File
A ready-to-paste prompt that builds an offline color tool turning one brand color into an even 50–900 OKLCH ramp with contrast badges and CSS or JSON token export.
Build a Button and Form Field States Reference Sheet in a Single HTML File
Get a polished, single-file reference sheet that shows button and text field states side by side, with a live playground and contrast ratios computed from design tokens.
Build a Multi-Step Onboarding Wizard with Stepper and Inline Validation
A four-step onboarding wizard in one HTML file, with a clickable stepper, progress bar, inline validation, a review screen, and keyboard and swipe navigation.
- Build a Playful Animated 404 Error Page with SVG Art and Site Search
- Build a Responsive Navigation Bar With Mega Menu and Mobile Drawer in HTML
- Build a Responsive Three-Tier Pricing Section with Monthly/Yearly Toggle
- Build a Testimonial and Logo Social-Proof Section in a Single HTML File
- Build an Accessible Modal, Toast and Tooltip Showcase in One HTML File
- Design an Accessible Settings Page with Toggles, Segmented Controls and Sliders