Color Letters in Text
Color individual letters in your text with rainbow, gradient, or custom color palettes. Export as HTML, CSS, or PNG image instantly.
About
Applying individual colors to each character in a string is a non-trivial formatting task. A naive approach assigns random hues, producing visual noise. This tool distributes colors algorithmically: rainbow mode maps the HSL color wheel across the character count using h = i ร 360 รท n, gradient mode performs linear RGB interpolation between two endpoints, and custom mode distributes up to 8 color stops with smooth transitions. Each character receives an inline color property via <span> wrapping. The output is valid HTML suitable for embedding in websites, emails, or social media bios. Note: exported PNG renders at 2ร resolution for retina displays but cannot preserve text selectability. For accessibility-critical contexts, colored text alone should not convey meaning per WCAG 1.4.1.
Formulas
Rainbow mode distributes hues evenly across the HSL color wheel for each visible character at index i out of n total visible characters:
Gradient mode interpolates linearly between two RGB color endpoints. For each channel c โ {R, G, B}:
Where hi is the hue in degrees at position i, n is total visible character count (whitespace excluded from coloring but preserved in output), cstart and cend are the RGB channel values of the gradient endpoints. Multi-stop custom gradients use piecewise linear interpolation between adjacent stops, with each segment length proportional to 1k โ 1 where k is the number of color stops.
Reference Data
| Color Mode | Algorithm | Best For | Color Count | Customizable |
|---|---|---|---|---|
| Rainbow | HSL wheel distribution | Headings, social media | Continuous spectrum | Saturation, Lightness |
| Gradient (2-color) | Linear RGB interpolation | Brand text, subtle styling | 2 endpoints | Start & end colors |
| Custom Stops | Multi-stop interpolation | Complex palettes | 2-8 stops | Each stop color |
| Random Pastel | Curated palette cycling | Playful, casual text | 12 preset hues | Palette selection |
| Monochrome Shades | Lightness variation | Elegant, minimal | 1 base hue | Base color |
| Warm Spectrum | HSL range 0ยฐ - 60ยฐ | Autumn, fire themes | Warm subset | Saturation |
| Cool Spectrum | HSL range 180ยฐ - 270ยฐ | Ocean, winter themes | Cool subset | Saturation |
| Neon | High saturation HSL | Dark backgrounds | Continuous | Lightness |
| Pastel | Low saturation, high lightness | Soft, gentle aesthetics | Continuous | Hue range |
| Flag Stripes | Block color assignment | National flags, pride | 3-7 blocks | Block colors |
| Alternating | 2-color toggle per char | Retro, bold contrast | 2 colors | Both colors |
| Wave | Sinusoidal HSL modulation | Animated effects | Continuous | Frequency, amplitude |