Function print_styled

Source
pub fn print_styled(text: &str, style: &str, color: &str)
Expand description

Prints text with both style and color

This function applies both a text style (like bold or underline) and a color to the provided text, then prints it.

§Arguments

  • text - The text to print
  • style - The style to apply (from Color constants)
  • color - The color to apply (from Color constants)

§Examples

use drgrep::color::config::Color;
use drgrep::color::printer::print_styled;

print_styled("Important warning", Color::BOLD, Color::YELLOW);
print_styled("Critical error", Color::BOLD, Color::RED);