Accent color: fixed text colors if using light accent color

(issue #233)
This commit is contained in:
Karl Tauber
2021-09-27 12:24:45 +02:00
parent 15c6f11a5e
commit caf2cd8487
2 changed files with 20 additions and 19 deletions

View File

@@ -35,8 +35,8 @@
@background = #3c3f41
@foreground = #bbb
@selectionBackground = @accentSelectionBackground
@selectionForeground = @foreground
@selectionInactiveBackground =spin(saturate(shade(@selectionBackground,70%),20%),-15)
@selectionForeground = contrast(@selectionBackground,@background,@foreground,39%)
@selectionInactiveBackground = spin(saturate(shade(@selectionBackground,70%),20%),-15)
@selectionInactiveForeground = @foreground
@disabledText = #888
@textComponentBackground = #45494A
@@ -54,12 +54,12 @@
@accentColor = null
@accentBaseColor = #4B6EAF
# 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%))
@accentButtonDefaultBackground = if(@accentColor, @accentColor, darken(spin(@accentBaseColor,-8),13%))
@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%))
@accentButtonDefaultBackground = if(@accentColor, @accentColor, darken(spin(@accentBaseColor,-8),13%))
# for buttons within components (e.g. combobox or spinner)
@buttonArrowColor = #9A9DA1
@@ -100,7 +100,7 @@ Button.hoverBorderColor = $Button.focusedBorderColor
Button.innerFocusWidth = 1
Button.default.background = @accentButtonDefaultBackground
Button.default.foreground = @foreground
Button.default.foreground = contrast($Button.default.background,@background,@foreground,25%)
Button.default.hoverBackground = lighten($Button.default.background,3%,derived)
Button.default.pressedBackground = lighten($Button.default.background,6%,derived)
Button.default.borderColor = tint($Button.default.background,15%)
@@ -240,8 +240,8 @@ PopupMenu.borderColor = #5e5e5e
ProgressBar.background = #555
ProgressBar.foreground = @accentSliderColor
ProgressBar.selectionForeground = @foreground
ProgressBar.selectionBackground = @foreground
ProgressBar.selectionForeground = contrast($ProgressBar.foreground,@background,@foreground,39%)
#---- RootPane ----

View File

@@ -35,7 +35,7 @@
@background = #f2f2f2
@foreground = #000
@selectionBackground = @accentSelectionBackground
@selectionForeground = #fff
@selectionForeground = contrast(@selectionBackground,@foreground,#fff)
@selectionInactiveBackground = #d4d4d4
@selectionInactiveForeground = @foreground
@disabledText = #8C8C8C
@@ -54,12 +54,13 @@
@accentColor = null
@accentBaseColor = #2675BF
# accent color variations
@accentCheckmarkColor = if(@accentColor, @accentColor, tint(@accentSliderColor,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%))
@accentUnderlineColor = if(@accentColor, @accentColor, tint(@accentBaseColor,10%))
@accentCheckmarkColor = if(@accentColor, @accentColor, tint(@accentSliderColor,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%))
@accentUnderlineColor = if(@accentColor, @accentColor, tint(@accentBaseColor,10%))
@accentButtonDefaultBorderColor = if(@accentColor, @accentColor, tint(@accentSliderColor,20%))
# for buttons within components (e.g. combobox or spinner)
@buttonArrowColor = #666
@@ -105,7 +106,7 @@ Button.default.foreground = @foreground
Button.default.focusedBackground = $Button.focusedBackground
Button.default.hoverBackground = darken($Button.default.background,3%,derived)
Button.default.pressedBackground = darken($Button.default.background,10%,derived)
Button.default.borderColor = @accentCheckmarkColor
Button.default.borderColor = @accentButtonDefaultBorderColor
Button.default.hoverBorderColor = $Button.hoverBorderColor
Button.default.focusedBorderColor = $Button.focusedBorderColor
Button.default.focusColor = $Component.focusColor
@@ -251,8 +252,8 @@ PopupMenu.borderColor = #adadad
ProgressBar.background = #D1D1D1
ProgressBar.foreground = @accentSliderColor
ProgressBar.selectionForeground = @textComponentBackground
ProgressBar.selectionBackground = @foreground
ProgressBar.selectionForeground = contrast($ProgressBar.foreground,@foreground,@textComponentBackground)
#---- RootPane ----