Remove color detection for tray icons

Always use white text with black shadow regardless of icon type
This commit is contained in:
Tunglies
2025-04-05 16:07:16 +08:00
parent 0b8d08d13b
commit 9dfd9bad20
2 changed files with 16 additions and 31 deletions

View File

@@ -125,18 +125,18 @@ pub fn open_file(_: tauri::AppHandle, path: PathBuf) -> Result<()> {
Ok(())
}
#[cfg(target_os = "macos")]
pub fn is_monochrome_image_from_bytes(data: &[u8]) -> anyhow::Result<bool> {
let img = image::load_from_memory(data)?;
let rgb_img = img.to_rgb8();
// #[cfg(target_os = "macos")]
// pub fn is_monochrome_image_from_bytes(data: &[u8]) -> anyhow::Result<bool> {
// let img = image::load_from_memory(data)?;
// let rgb_img = img.to_rgb8();
for pixel in rgb_img.pixels() {
if pixel[0] != pixel[1] || pixel[1] != pixel[2] {
return Ok(false);
}
}
Ok(true)
}
// for pixel in rgb_img.pixels() {
// if pixel[0] != pixel[1] || pixel[1] != pixel[2] {
// return Ok(false);
// }
// }
// Ok(true)
// }
#[cfg(target_os = "linux")]
pub fn linux_elevator() -> String {