Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

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
  • --bgstart, -c {string}: background gradient start color in hex
  • --bgend, -d {string}: background gradient end color in hex

Parameters

  • ...rest: For a data structure input, add a gradient to strings at the given cell paths.

Input/output types:

inputoutput
list<string>list<string>
recordrecord
stringstring
tabletable

Examples

draw text in a gradient with foreground start and end colors

> 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff'

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'

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'

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'