Skip to main content

color

Macro color 

Source
color!() { /* proc-macro */ }
Expand description

Expands to a call to the Colorize trait, reducing boilerplate. If a single value is provided, it converts to a call to Colorize::colorize with the provided value. If none, or multiple values are provided, it converts to a call to Colorize::colorizes with a vector of the provided values. This macro can be used with any type that implements the Colorize trait, including:

  • Colored
  • String
  • str

§Parameters

  • value of type T with trait Colorize
  • n ColorType variants where n is [0, ∞)

§Example

term_render::color!("Hello World", White, Bold, Underline);
term_render::color!("Hello World");  // converts to Colored without applying modifiers