
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
rich-gradient
Advanced tools
rich-gradient layers smooth foreground and background gradients on top of
Rich renderables.
It includes a drop-in Text subclass, wrappers for Panel and Rule,
utilities for building palettes, and
a rich-click (Click) CLI for trying gradients from the terminal.
ConsoleRenderable,
including panels, tables, and live updates.rich.color.Color objects.RuleSpectrum~/.rich-gradient) where you can toggle
animation globally and customise the default spectrum palette.Added support for reading input from stdin when no subcommand is provided.
rich-gradient 'Who likes gradients?echo "Hello, World!" | rich-gradientBugfix:
AnimatedGradient, AnimatedPanel,
AnimatedMarkdown, and AnimatedRule) no longer clears the console on start();transient=True, the final gradient render persists.See the CHANGELOG for more details.
rich-gradient targets Python 3.10+.
# Recommended: use uv
uv add rich-gradient
# or via `uv pip`
uv pip install rich-gradient
Or with pip:
# via pip
pip install rich-gradient
The CLI is built with Click + rich-click. Subcommands:
print: gradient text. Options:
--colors/-c--bgcolors--rainbow--hues--style--justify--overflow--no-wrap--end--animate--duration--colors/-c--bgcolors--rainbow--hues--style--justify--vertical-justify--overflow--no-wrap--end--animate--durationrule: gradient rule. Options:
--title--title-style--colors--bgcolors--rainbow--hues--thickness--align--end--animate--durationpanel: gradient panel. Options:
--colors--bgcolors--rainbow--hues--title--title-style--title-align--subtitle--subtitle-style--subtitle-align--style--border-style--padding--vertical-justify--text-justify--justify--expand/--no-expand--width--height--box--end--animate--durationmarkdown: gradient markdown. Options:
--colors--bgcolors--rainbow--hues--style--justify--vertical-justify--overflow--no-wrap--end--animate--durationQuick examples:
rich-gradient "Hello [b]world[/b]! " -c '#f00,#f90,#ff0'rich-gradient "All the colors of the rainbow! " --rainbowrich-gradient panel -t 'Panel Title' "Gradient Panel content..."
-c red,blue --title "Gradient Panel"`rich-gradient rule --title "Section" -c "#f00,#0ff"rich-gradient markdown "# Title" --colors "#ff0,#0ff" --justify centerpytest works without an editable install because
tests/conftest.py adds src/ to sys.path. No extra
env tweaks needed; just install deps and run pytest.To print a simple gradient just substitute the Gradient class
for the Text class in the rich-gradient library.
from rich.console import Console
from rich_gradient import Gradient
console = Console()
console.print(Gradient("Hello, World!"))
If you want a bit more control of the gradient,
you can specify the colors you want to use in the gradient
by passing them as a list of colors to the colors parameter.
Color can be parsed from a variety of formats including:
console.print(
Text(
"This a gradient with two colors.",
colors=["red", "orange"]
),
justify="center"
)
console.print(
Text(
"This a gradient uses four specific colors.",
colors=["red", "#ff9900", "#ff0", "Lime"],
justify="center"
)
)
If four colors aren't enough, you can use the 'rainbow' parameter to generate a rainbow gradient that spans the entire spectrum of colors randomly.
console.print(
Text(
"This is a rainbow gradient.",
rainbow=True,
justify="center"
)
)
The rainbow gradient is generated randomly each time the code is run.
rich.text.TextSince Gradient is a subclass of Text, you can still use all
the same methods and properties as you would with Text.
console.print(
Gradient(
"This is an underlined rainbow gradient.",
rainbow=True,
style="underline"
),
justify="center"
)
console.line()
console.print(
Gradient(
"This is a bold italic gradient.",
style="bold italic"
),
justify="center"
)
console.line()
FAQs
A gradient generator for the Rich library.
We found that rich-gradient demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.