// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie // SPDX-License-Identifier: MIT //! Whether the user chose dark or light for programs, in Settings' //! Personalization > Colors: what the portal reports as the color scheme //! and the platform gives the frames Windows draws, so that the two agree. const win32 = @import("win32").everything; const L = @import("std").unicode.utf8ToUtf16LeStringLiteral; /// True for dark; light when the user never chose, as Windows has it. pub fn dark() bool { var light: u32 = 1; var size: u32 = @sizeOf(u32); const err = win32.RegGetValueW( win32.HKEY_CURRENT_USER, L("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"), L("AppsUseLightTheme"), win32.RRF_RT_REG_DWORD, null, &light, &size, ); return err == .NO_ERROR and light == 0; }