mirror of
https://github.com/Xyverle/neutuino.git
synced 2026-06-26 22:23:14 -04:00
add background truecolor support
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3,5 +3,5 @@
|
|||||||
version = 4
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "neutrino"
|
name = "neutuino"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|||||||
@@ -6,10 +6,16 @@
|
|||||||
|
|
||||||
/// Sets the terminal to an arbitrary 12-bit/truecolor color
|
/// Sets the terminal to an arbitrary 12-bit/truecolor color
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn rgb_color_code(red: u8, green: u8, blue: u8) -> String {
|
pub fn rgb_color_code_fg(red: u8, green: u8, blue: u8) -> String {
|
||||||
format!("\x1b[38;2;{red};{green};{blue}m")
|
format!("\x1b[38;2;{red};{green};{blue}m")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the terminal to an arbitrary 12-bit/truecolor color
|
||||||
|
#[must_use]
|
||||||
|
pub fn rgb_color_code_bg(red: u8, green: u8, blue: u8) -> String {
|
||||||
|
format!("\x1b[48;2;{red};{green};{blue}m")
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets the title of the window
|
/// Sets the title of the window
|
||||||
///
|
///
|
||||||
/// The title must be only in ASCII characters or **weird** things will happen
|
/// The title must be only in ASCII characters or **weird** things will happen
|
||||||
|
|||||||
Reference in New Issue
Block a user