Text Gradient

txt-gradient

Fills the text of a video overlay with a linear gradient instead of a solid color.

txt-gradient takes a comma-separated list of 2 to 16 colors, spaced evenly across the text — txt-gradient=FF2200,0044FF runs red to blue. A single color is not a gradient and is ignored, as is a malformed stop or a list longer than 16; in each case the text falls back to txt-color. Control the direction with txt-gradient-angle, and use txt-gradient[N] for a specific text layer.

When txt-gradient is set it replaces txt-color entirely — the gradient does not start from the text color, and txt-color only comes back if the gradient is rejected.

Each stop accepts a hex color value (with an optional # or 0x prefix) in the RGB, ARGB, RRGGBB or AARRGGBB form, or a CSS color name. In the 4- and 8-digit forms the alpha comes first, as it does everywhere in Imgix — 80FFFFFF is white at 50% opacity. CSS writes alpha last, so a value copied from a stylesheet will be wrong: FFFFFF80 is opaque, not translucent. Stop alpha is honored and stops blend premultiplied, so a gradient can fade the glyphs out across their own width.

The gradient fills the glyph outlines only — color emoji keep their own colors.

For the full list of text overlay parameters, see the Text Overlays overview.

txt-gradient fills the text itself. To draw a scrim behind the text so it stays legible over bright footage, use gradient.