From e31e4dfe3a6f7f7f6634cc2cf3da4d072ab0a468 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 27 Sep 2021 12:31:49 +0200 Subject: [PATCH] Accent color: avoid that @accentXYZ variables depend on other @accentXYZ variables to allow independent modification (issue #233) --- .../resources/com/formdev/flatlaf/FlatDarkLaf.properties | 5 +++-- .../resources/com/formdev/flatlaf/FlatLightLaf.properties | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 7845d865..16742af2 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -53,12 +53,13 @@ # modify @accentBaseColor to use variations of accent base color @accentColor = null @accentBaseColor = #4B6EAF +@accentBase2Color = lighten(saturate(spin(@accentBaseColor,-8),13%),5%) # accent color variations @accentFocusColor = if(@accentColor, @accentColor, shade(spin(@accentBaseColor,-8),20%)) @accentLinkColor = if(@accentColor, @accentColor, lighten(saturate(spin(@accentBaseColor,-5),50%),16%)) @accentSelectionBackground = if(@accentColor, @accentColor, @accentBaseColor) -@accentSliderColor = if(@accentColor, @accentColor, @accentUnderlineColor) -@accentUnderlineColor = if(@accentColor, @accentColor, lighten(saturate(spin(@accentBaseColor,-8),13%),5%)) +@accentSliderColor = if(@accentColor, @accentColor, @accentBase2Color) +@accentUnderlineColor = if(@accentColor, @accentColor, @accentBase2Color) @accentButtonDefaultBackground = if(@accentColor, @accentColor, darken(spin(@accentBaseColor,-8),13%)) # for buttons within components (e.g. combobox or spinner) diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index 2bd0a9e5..525bb525 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -53,14 +53,15 @@ # modify @accentBaseColor to use variations of accent base color @accentColor = null @accentBaseColor = #2675BF +@accentBase2Color = lighten(saturate(@accentBaseColor,10%),6%) # accent color variations -@accentCheckmarkColor = if(@accentColor, @accentColor, tint(@accentSliderColor,20%)) +@accentCheckmarkColor = if(@accentColor, @accentColor, tint(@accentBase2Color,20%)) @accentFocusColor = if(@accentColor, @accentColor, lighten(@accentBaseColor,31%)) @accentLinkColor = if(@accentColor, @accentColor, darken(@accentBaseColor,3%)) @accentSelectionBackground = if(@accentColor, @accentColor, @accentBaseColor) -@accentSliderColor = if(@accentColor, @accentColor, lighten(saturate(@accentBaseColor,10%),6%)) +@accentSliderColor = if(@accentColor, @accentColor, @accentBase2Color) @accentUnderlineColor = if(@accentColor, @accentColor, tint(@accentBaseColor,10%)) -@accentButtonDefaultBorderColor = if(@accentColor, @accentColor, tint(@accentSliderColor,20%)) +@accentButtonDefaultBorderColor = if(@accentColor, @accentColor, tint(@accentBase2Color,20%)) # for buttons within components (e.g. combobox or spinner) @buttonArrowColor = #666