Color Paragraphs in Text
Color-code each paragraph in your text with custom palettes. Sequential, random, gradient, or alternating modes. Copy or export colored HTML.
About
Distinguishing paragraphs visually reduces misreading risk in long documents, lecture notes, or legal contracts. A wall of uniform text causes skipping errors at rates up to 15% per page in proofreading studies. This tool assigns a distinct background color to each paragraph using one of four algorithms: sequential palette cycling, pseudo-random distribution, two-color alternation, or HSL gradient interpolation between user-defined endpoints. It operates on plain text split by blank-line delimiters. The output is copyable rich HTML or exportable as a standalone .html file. Note: color contrast is not guaranteed for arbitrary palettes - verify readability against WCAG AA (4.5:1 ratio) if the output is intended for accessibility-sensitive contexts.
Formulas
In Gradient mode, intermediate colors are computed via HSL interpolation. For n paragraphs between start color C0 and end color C1:
The same linear interpolation applies to S (saturation) and L (lightness) channels independently. Where i is the paragraph index (0-based), H0, S0, L0 are the HSL components of the start color, and H1, S1, L1 are those of the end color.
In Sequential mode, paragraph i receives palette color at index:
In Random mode, the palette array is shuffled using Fisher-Yates algorithm, then cycled sequentially through the shuffled order. In Alternating mode, only the first two palette colors are used, toggling on parity of i.
Reference Data
| Color Mode | Algorithm | Best Use Case | Min. Palette Size |
|---|---|---|---|
| Sequential | Cycle through palette in order, wrap at end | Structured documents, numbered sections | 2 |
| Random | Fisher-Yates shuffle of palette per batch | Creative writing, visual variety | 3 |
| Alternating | Two-color toggle (even/odd index) | Contracts, comparison text, zebra-striping | 2 |
| Gradient | HSL interpolation between two endpoints | Progress narratives, timeline documents | 2 (endpoints) |
| Common Pastel Palettes | |||
| Soft Rainbow | #FFB3BA, #FFDFBA, #FFFFBA, #BAFFC9, #BAE1FF, #E8BAFF | ||
| Ocean Breeze | #B5EAD7, #C7CEEA, #E2F0CB, #FFDAC1, #FF9AA2 | ||
| Warm Sunset | #FDCB82, #F8A978, #F48B94, #D98BB5, #B48BCC | ||
| Cool Mint | #D4F1F4, #B8E6E6, #96D9D6, #75C9C8, #54B9B9 | ||
| Earth Tones | #E6CCB2, #DDB892, #B08968, #C4A77D, #D4C5A9 | ||
| Berry Mix | #F0C6D0, #E0A8C8, #D08CC0, #C070B8, #B054B0 | ||
| Lemon Fields | #FFF9C4, #FFF59D, #FFF176, #FFEE58, #FFEB3B | ||
| Forest | #C8E6C9, #A5D6A7, #81C784, #66BB6A, #4CAF50 | ||
| Lavender Dream | #E8D5F5, #D4B8E8, #C09BDB, #AC7ECE, #9861C1 | ||
| Coral Reef | #FECDD3, #FDA4AF, #FB7185, #F43F5E, #E11D48 | ||