Stop googling "hex to rgb" twenty times a day. Build a color converter that shows HEX, RGB, HSL, and CMYK simultaneously, updates all values live as you edit any format, checks contrast ratios against white and black text for WCAG compliance, and remembers your recent colors. One tool to handle every color format conversion a developer or designer needs.
Build Prompt
Copy this prompt into Claude Code
Build a single-page Color Converter tool as a static HTML file with embedded CSS and JavaScript. No frameworks or dependencies.
LAYOUT:
- Dark theme (background #0d1117, text #c9d1d9)
- Center-aligned content, max-width 700px
- Header: "Color Converter" title with subtitle "HEX / RGB / HSL / CMYK — edit any format, all update live"
- Main sections from top to bottom: Color Preview, Format Inputs, Contrast Checker, Color Name, Recent Colors
COLOR PREVIEW:
- Large swatch rectangle (100% width, 160px tall, rounded 12px) showing the current color
- Checkerboard pattern behind it for when colors have transparency
- Native HTML color picker input (type="color") positioned as a small button in the top-right corner of the swatch labeled "Pick"
- Clicking the swatch itself also triggers the color picker
FORMAT INPUTS:
- Four cards in a 2x2 grid, each containing:
HEX card:
- Label "HEX" in small caps
- Text input showing the hex value with # prefix (e.g., #3b82f6)
- Support 3-digit shorthand (#abc) auto-expanding to 6-digit
- Small copy button (clipboard icon) next to the input
- Validate: only allow 0-9, a-f, A-F characters
RGB card:
- Label "RGB"
- Three number inputs side by side for R (0-255), G (0-255), B (0-255)
- Range slider below each input that matches the value
- CSS string display below: rgb(59, 130, 246)
- Copy button copies the CSS string
HSL card:
- Label "HSL"
- Three inputs: H (0-360 degrees), S (0-100%), L (0-100%)
- H input has a hue gradient slider background
- S and L inputs have range sliders
- CSS string display: hsl(217, 91%, 60%)
- Copy button copies the CSS string
CMYK card:
- Label "CMYK"
- Four inputs: C (0-100%), M (0-100%), Y (0-100%), K (0-100%)
- Display string: cmyk(76%, 47%, 0%, 4%)
- Copy button copies the string
- When the user edits ANY input in ANY card, all other cards update immediately
- Debounce updates by 50ms to avoid input lag
- Invalid values show a red border on the input with no update until valid
CONTRAST CHECKER:
- Two rectangular boxes side by side:
- Left box: current color background with WHITE text "Aa Sample Text"
- Right box: current color background with BLACK text "Aa Sample Text"
- Below each box show:
- Contrast ratio (e.g., "4.53:1")
- WCAG AA rating for normal text: "Pass" (green) or "Fail" (red)
- WCAG AA rating for large text: "Pass" or "Fail"
- WCAG AAA rating for normal text: "Pass" or "Fail"
- Use the WCAG 2.1 relative luminance formula for contrast calculation
- Thresholds: AA normal >= 4.5:1, AA large >= 3:1, AAA normal >= 7:1, AAA large >= 4.5:1
COLOR NAME:
- Display the closest named CSS color (e.g., "dodgerblue", "coral", "mediumseagreen")
- Include the full list of 148 CSS named colors
- Show the exact named color swatch next to it and the delta (how close the match is)
- If exact match, show "Exact match!" in green
RECENT COLORS:
- Horizontal row of small square swatches (32x32px) showing the last 12 colors used
- Stored in localStorage
- Click a swatch to load that color back into the converter
- Small X button on hover to remove a color from history
- "Clear All" link at the end
COPY BEHAVIOR:
- Each copy button shows a small "Copied!" tooltip for 1.5 seconds
- Copy buttons are small icon-style buttons (not full-width)
KEYBOARD SHORTCUTS:
- Tab cycles between format inputs naturally
- Enter in hex input triggers conversion
- Ctrl+Shift+C copies the HEX value
Make it responsive: on mobile, format cards stack to single column. Contrast boxes stack vertically. Recent colors wrap to two rows.
Make It Yours
Color Blindness Simulator
Show how the selected color appears under protanopia, deuteranopia, and tritanopia using color transformation matrices.
Palette Generator
Generate complementary, analogous, triadic, and split-complementary palettes from the selected color with one click.
Image Color Picker
Allow users to upload an image and click on any pixel to extract its color values into the converter.
Tailwind Color Match
Show the closest Tailwind CSS color class (e.g., blue-500) and its exact hex value so users can map custom colors to Tailwind.
SEO Tips
Target direct conversion queries like "hex to rgb converter", "rgb to hsl", and "hex to cmyk" as these have high search volume with clear intent.
Create dedicated pages for each conversion direction ("/hex-to-rgb", "/rgb-to-hsl", "/hsl-to-hex") to capture specific long-tail queries.
Add a color name lookup page ("/color-names") listing all 148 CSS named colors with swatches, hex values, and RGB. This page will attract backlinks.
Include a FAQ section with questions like "What is the difference between RGB and CMYK?" and "How to check color contrast for accessibility?" for featured snippets.
Use the WebApplication structured data schema with "free" pricing to appear in rich search results.
Monetization Ideas
Sell a "Designer Color Kit" PDF with 200 curated color palettes organized by industry (tech, health, food, finance) for $12.
Offer a Pro tier ($3/month) with features: unlimited palette saves, color blindness simulation, export to Figma/Sketch variables.
Build a Chrome extension that adds a floating color picker on any webpage, identifying colors on hover. Charge $4.99 one-time.
Create an API that accepts a color in any format and returns all conversions plus accessibility ratings. Charge per 10,000 calls for design tool integrations.
Partner with design education platforms to feature your tool in their courses, earning affiliate commissions on course signups.