generated from PlexSheep/baserepo
Compare commits
2 commits
8070f0b100
...
0179c53e82
Author | SHA1 | Date | |
---|---|---|---|
0179c53e82 | |||
08bfc03628 |
1 changed files with 7 additions and 4 deletions
|
@ -42,7 +42,7 @@ pub fn blockprint(content: impl ToString, color: Color) {
|
|||
pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
||||
blockfmt_advanced(
|
||||
content,
|
||||
color,
|
||||
Some(color),
|
||||
presets::UTF8_BORDERS_ONLY,
|
||||
ContentArrangement::DynamicFullWidth,
|
||||
CellAlignment::Center,
|
||||
|
@ -67,7 +67,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
|||
/// "{}",
|
||||
/// blockfmt_advanced(
|
||||
/// "Hello world!".to_string(),
|
||||
/// Color::Blue,
|
||||
/// Some(Color::Blue),
|
||||
/// presets::UTF8_FULL,
|
||||
/// ContentArrangement::DynamicFullWidth,
|
||||
/// CellAlignment::Center
|
||||
|
@ -86,7 +86,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
|||
///
|
||||
pub fn blockfmt_advanced(
|
||||
content: impl ToString,
|
||||
color: Color,
|
||||
color: Option<Color>,
|
||||
preset: &str,
|
||||
arrangement: ContentArrangement,
|
||||
alignment: CellAlignment,
|
||||
|
@ -98,5 +98,8 @@ pub fn blockfmt_advanced(
|
|||
.add_row(vec![content.to_string()]);
|
||||
table.column_mut(0).unwrap().set_cell_alignment(alignment);
|
||||
|
||||
format!("{}", style(table).fg(color))
|
||||
match color {
|
||||
Some(c) => format!("{}", style(table).fg(c)),
|
||||
None => table.to_string(),
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue