mirror of
https://github.com/dathere/ckan-devstaller.git
synced 2025-12-27 11:26:59 +00:00
refactor: colored text
This commit is contained in:
parent
fe656fc242
commit
572cfab8ca
2 changed files with 61 additions and 68 deletions
29
src/styles.rs
Normal file
29
src/styles.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use owo_colors::{OwoColorize, Stream::Stdout};
|
||||
|
||||
pub fn highlighted_text(text: &str) -> impl std::fmt::Display {
|
||||
format!(
|
||||
"{}",
|
||||
text.if_supports_color(Stdout, |t| t.on_blue().white())
|
||||
)
|
||||
}
|
||||
|
||||
pub fn important_text(text: &str) -> impl std::fmt::Display {
|
||||
format!(
|
||||
"{}",
|
||||
text.if_supports_color(Stdout, |t| t.on_bright_red().white())
|
||||
)
|
||||
}
|
||||
|
||||
pub fn step_text(text: &str) -> impl std::fmt::Display {
|
||||
format!(
|
||||
"{}",
|
||||
text.if_supports_color(Stdout, |t| t.on_magenta().white())
|
||||
)
|
||||
}
|
||||
|
||||
pub fn success_text(text: &str) -> impl std::fmt::Display {
|
||||
format!(
|
||||
"{}",
|
||||
text.if_supports_color(Stdout, |t| t.on_green().white())
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue