fix: default to system accent color on invalid user color (#47684)

fix: default to system accent color on invalid user color"

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2025-07-08 15:21:44 +02:00
committed by GitHub
parent 130f00dfcd
commit 0b77096f2a
11 changed files with 38 additions and 41 deletions

View File

@@ -235,7 +235,7 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
SkColor background_color = SK_ColorWHITE;
if (std::string color; options.Get(options::kBackgroundColor, &color)) {
background_color = ParseCSSColor(color);
background_color = ParseCSSColor(color).value_or(SK_ColorWHITE);
} else if (IsTranslucent()) {
background_color = SK_ColorTRANSPARENT;
}