diff --git a/Cargo.lock b/Cargo.lock index 7aa7828..549f278 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,5 @@ version = 4 [[package]] -name = "neutrino" +name = "neutuino" version = "0.1.0" diff --git a/src/ansi.rs b/src/ansi.rs index 76413ce..d0dbd3f 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -6,10 +6,16 @@ /// Sets the terminal to an arbitrary 12-bit/truecolor color #[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") } +/// 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 /// /// The title must be only in ASCII characters or **weird** things will happen