ansi gradient for platform
Add a color gradient (using ANSI color codes) to the given string.
Signature
> ansi gradient {flags} ...rest
Flags
-
--fgstart, -a {string}: Foreground gradient start color in hex (0x123456). -
--fgend, -b {string}: Foreground gradient end color in hex. -
--fgnamed, -F {string}: Named foreground gradient. -
--bgstart, -c {string}: Background gradient start color in hex. -
--bgend, -d {string}: Background gradient end color in hex. -
--bgnamed, -B {string}: Named background gradient. -
--list, -l: List available named gradients and show an example.
Parameters
-
...rest: For a data structure input, add a gradient to strings at the given cell paths.
Input/output types:
| input | output |
|---|---|
| string | string |
| list<string> | list<string> |
| table | table |
| record | record |
| nothing | string |
Examples
draw text in a gradient with foreground start and end colors
> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' Hello, Nushell! This is a gradient.
draw text in a gradient with foreground start and end colors and background start and end colors
> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' --bgstart '0xe81cff' --bgend '0x40c9ff' Hello, Nushell! This is a gradient.
draw text in a gradient by specifying foreground start color - end color is assumed to be black
> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' Hello, Nushell! This is a gradient.
draw text in a gradient by specifying foreground end color - start color is assumed to be black
> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend '0xe81cff' Hello, Nushell! This is a gradient.
draw text in a gradient using a named rainbow foreground gradient
> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgnamed rainbow Hello, Nushell! This is a gradient.
draw text in a gradient using a named forest background gradient
> 'Hello, Nushell! This is a gradient.' | ansi gradient --bgnamed forest Hello, Nushell! This is a gradient.
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/ansi_gradient.html