1use std::fmt::Display;
2
3use owo_colors::{OwoColorize, Stream::Stdout};
4
5#[inline]
7pub fn dim<T>(text: &T) -> impl Display + '_
8where
9 T: Display + OwoColorize,
10{
11 text.if_supports_color(Stdout, |t| t.dimmed())
12}
13
14#[inline]
16pub fn red<T>(text: &T) -> impl Display + '_
17where
18 T: Display + OwoColorize,
19{
20 text.if_supports_color(Stdout, |t| t.red())
21}
22
23#[inline]
25pub fn yellow<T>(text: &T) -> impl Display + '_
26where
27 T: Display + OwoColorize,
28{
29 text.if_supports_color(Stdout, |t| t.yellow())
30}
31
32#[inline]
34pub fn cyan<T>(text: &T) -> impl Display + '_
35where
36 T: Display + OwoColorize,
37{
38 text.if_supports_color(Stdout, |t| t.cyan())
39}