Skip to content

Commit d3cd950

Browse files
Tweaking the visuals of disabled controls in tonal Autumn
For #400
1 parent dc05e35 commit d3cd950

File tree

1 file changed

+7
-4
lines changed
  • theming/src/main/java/org/pushingpixels/radiance/theming/api/skin

1 file changed

+7
-4
lines changed

theming/src/main/java/org/pushingpixels/radiance/theming/api/skin/AutumnSkin.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ public AutumnTonalSkin() {
167167
.onContainerVariant(DynamicScheme::getTonalContainerOutlineVariant)
168168
.build())
169169
// For muted containers (enabled controls), use tonal outlines for border
170-
// consistency with active controls, and softer text / icon colors
170+
// consistency with active controls, and softer text / icon colors. Also use
171+
// higher alpha values for disabled controls for better contrast.
171172
.mutedContainerResolverOverlay(
172173
SchemeContainerColorsResolverOverlay.builder()
173174
.containerOutline(DynamicScheme::getTonalContainerOutline)
@@ -178,12 +179,13 @@ public AutumnTonalSkin() {
178179
.onContainerDisabledAlpha((s) -> 0.6f)
179180
.containerOutlineDisabledAlpha((s) -> 0.55f)
180181
.build())
181-
// For tonal containers (active controls), use softer text / icon colors
182+
// For tonal containers (active controls), use softer text / icon colors.
183+
// Also use higher alpha values for disabled controls for better contrast.
182184
.tonalContainerResolverOverlay(
183185
SchemeContainerColorsResolverOverlay.builder()
184186
.onContainer(DynamicScheme::getTonalContainerOutline)
185187
.onContainerVariant(DynamicScheme::getTonalContainerOutlineVariant)
186-
.containerSurfaceDisabledAlpha((s) -> 0.5f)
188+
.containerSurfaceDisabledAlpha((s) -> 0.4f)
187189
.onContainerDisabledAlpha((s) -> 0.6f)
188190
.containerOutlineDisabledAlpha((s) -> 0.55f)
189191
.build())
@@ -201,14 +203,15 @@ public AutumnTonalSkin() {
201203
// Custom visuals for controls in selected state:
202204
// 1. Deeper container surfaces (more saturated seed in fidelity mode)
203205
// 2. Softer on container, mapped to container outline (used for texts and icons)
206+
// 3. Higher alpha values for disabled controls for better contrast
204207
autumnDefaultBundle.registerContainerTokens(ColorSchemeUtils.getContainerTokens(
205208
/* seed */ Hct.fromInt(0xFFFDBD72),
206209
/* isFidelity */ true,
207210
/* isDark */ false,
208211
/* colorResolver */ PaletteResolverUtils.getPaletteTonalColorResolver().overlayWith(
209212
PaletteContainerColorsResolverOverlay.builder()
210213
.onContainer(DynamicPalette::getTonalContainerOutline)
211-
.containerSurfaceDisabledAlpha((s) -> 0.5f)
214+
.containerSurfaceDisabledAlpha((s) -> 0.4f)
212215
.onContainerDisabledAlpha((s) -> 0.6f)
213216
.containerOutlineDisabledAlpha((s) -> 0.55f)
214217
.build())),

0 commit comments

Comments
 (0)