Color Symbols in Text
Color each character, word, or line in your text with rainbow, gradient, or custom palettes. Copy rich HTML or export as PNG image.
About
Applying color to individual symbols in a block of text requires precise mapping of a color function f(i) to each character index i across a total of n glyphs. Get the distribution wrong and the result looks like noise rather than a coherent gradient or pattern. This tool computes hue assignments using HSL color space rotation, linear RGB interpolation for two-color gradients, and cyclic palette indexing for custom schemes. It operates on three granularity levels: per-character, per-word, and per-line.
Output is standard inline HTML with style attributes, compatible with any rich-text editor, email client, or CMS that accepts pasted formatted text. For platforms that strip HTML, the PNG export rasterizes the colored text onto a transparent canvas. Note: results depend on the rendering engine of the destination platform. Some chat apps will discard inline styles on paste.
Formulas
The primary color assignment for rainbow mode uses HSL color space rotation across the total number of tokens:
Where Hi is the hue in degrees for token at index i, and n is the total number of tokens. Saturation S and Lightness L remain constant (defaults: S = 80%, L = 55%).
For two-color gradient mode, each RGB channel is linearly interpolated:
Where Cstart and Cend are the RGB triplets of the two chosen colors. This is applied independently to each channel (R, G, B).
For cyclic palette mode with k colors in the palette array:
Reference Data
| Color Mode | Algorithm | Best For | Parameters |
|---|---|---|---|
| Rainbow | HSL hue rotation: H = 360 ร i รท n | Full-spectrum colorful text | Saturation, Lightness |
| Gradient (2-color) | Linear RGB lerp: C = C1 + t(C2 โ C1) | Smooth fade between two colors | Start color, End color |
| Custom Palette | Cyclic index: C = palette[i mod k] | Brand colors, themed patterns | Array of k colors |
| Random | Pseudo-random HSL with constrained S/L | Playful, chaotic styling | Min/Max lightness |
| Alternating | Binary toggle: i mod 2 | Two-tone highlighting | Color A, Color B |
| Warm Spectrum | Hue range 0ยฐ - 60ยฐ | Red-orange-yellow themes | Saturation, Lightness |
| Cool Spectrum | Hue range 180ยฐ - 270ยฐ | Blue-cyan-purple themes | Saturation, Lightness |
| Neon | High saturation (100%), mid lightness (50%) | Vibrant, attention-grabbing | Hue rotation speed |
| Pastel | Low saturation (60%), high lightness (80%) | Soft, elegant text | Hue rotation speed |
| Monochrome Fade | Single hue, varying lightness 30 - 80% | Depth effect within one color | Base hue |
| Per-Word | Same algorithms applied at word boundaries | Readable multi-color text | Any color mode above |
| Per-Line | Same algorithms applied at line boundaries | Paragraph-level coloring | Any color mode above |