Replies: 2 comments
-
Tauri does not have an API for that yet. It's being worked on for macOS at least: tauri-apps/tao#589 A rust based solution would look something like this (using let mut colorization: u32 = 0;
let mut opaqueblend = windows::Win32::Foundation::BOOL(0);
unsafe {
windows::Win32::Graphics::Dwm::DwmGetColorizationColor(&mut colorization, &mut opaqueblend)
}; // this can return an error
let argb = hex::decode(format!("{:X}", colorization)).unwrap(); // this too, so don't use unwrap if you don't wanna see your app crashing. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is another solution that uses pub fn system_accent_color() -> Option<String> {
let settings = UISettings::new().ok()?;
// You can change `UIColorType` variant to get different shading
let color = settings.GetColorValue(UIColorType::Accent).ok()?;
let color_rgb = format!("rgba({},{},{},{})", color.R, color.G, color.B, color.A);
Some(color_rgb)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How i can get the system accent color in Windows?
In the
windows
package i've foundwindows::Win32::Graphics::Dwm::DwmGetColorizationColor
but i'm not fluent with rust so basically i don't know how i can call itBtw, I don't know if it could be a feature request or something that exists but it's not documented
Beta Was this translation helpful? Give feedback.
All reactions