summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock11
-rw-r--r--Cargo.toml2
-rw-r--r--src/options/theme.rs6
3 files changed, 9 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 19e6547..0828a5a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1259,23 +1259,24 @@ dependencies = [
[[package]]
name = "terminal-colorsaurus"
-version = "0.3.1"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c374383f597b763eb3bd06bc4e18f85510a52d7f1ac762f0c7e413ce696079fc"
+checksum = "f25695f34d6f2acfa6c9dc41348e9a38d66cda2a78a010d5eafee6df69d8cc69"
dependencies = [
+ "cfg-if",
"libc",
"memchr",
"mio",
"terminal-trx",
- "thiserror",
]
[[package]]
name = "terminal-trx"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a4af7c93f02d5bd5e120c812f7fb413003b7060e8a22d0ea90346f1be769210"
+checksum = "6d4c86910e10c782a02d3b7606de43cf7ebd80e1fafdca8e49a0db2b0d4611f0"
dependencies = [
+ "cfg-if",
"libc",
"windows-sys 0.52.0",
]
diff --git a/Cargo.toml b/Cargo.toml
index 3234a71..65bb723 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -54,7 +54,7 @@ unicode-segmentation = "1.10.1"
unicode-width = "0.1.10"
xdg = "2.4.1"
clap_complete = "4.4.4"
-terminal-colorsaurus = "0.3.1"
+terminal-colorsaurus = "0.4.1"
[dependencies.git2]
version = "0.18.2"
diff --git a/src/options/theme.rs b/src/options/theme.rs
index 7c1dbce..20e43aa 100644
--- a/src/options/theme.rs
+++ b/src/options/theme.rs
@@ -126,16 +126,14 @@ fn should_detect_dark_light(opt: &cli::Opt) -> bool {
}
fn detect_light_mode() -> bool {
- use terminal_colorsaurus::{color_scheme, QueryOptions};
+ use terminal_colorsaurus::{color_scheme, ColorScheme, QueryOptions};
#[cfg(test)]
if let Some(value) = test_utils::DETECT_LIGHT_MODE_OVERRIDE.get() {
return value;
}
- color_scheme(QueryOptions::default())
- .map(|c| c.is_dark_on_light())
- .unwrap_or_default()
+ color_scheme(QueryOptions::default()).unwrap_or_default() == ColorScheme::Light
}
#[cfg(test)]