aboutsummaryrefslogtreecommitdiff
path: root/src/terminal_theme.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal_theme.rs')
-rw-r--r--src/terminal_theme.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/terminal_theme.rs b/src/terminal_theme.rs
index 154b36fe..ffe78a95 100644
--- a/src/terminal_theme.rs
+++ b/src/terminal_theme.rs
@@ -11,6 +11,15 @@ pub enum HostAppearance {
Light,
}
+impl HostAppearance {
+ pub const fn color_scheme_report(self) -> &'static [u8] {
+ match self {
+ Self::Dark => b"\x1b[?997;1n",
+ Self::Light => b"\x1b[?997;2n",
+ }
+ }
+}
+
impl RgbColor {
pub fn inferred_appearance(self) -> HostAppearance {
let luminance = u32::from(self.r) * 299 + u32::from(self.g) * 587 + u32::from(self.b) * 114;