From 3eebd1a0bd39f0a08b3ecf5402176619979308e3 Mon Sep 17 00:00:00 2001 From: Kirill Grouchnikov Date: Sat, 4 Jan 2025 10:47:19 -0500 Subject: [PATCH] Rename tonal container APIs container -> container surface For #400 --- .../theming/main/check/FakeAccordion.java | 2 +- .../main/palette/ContainerPalettePreview.java | 10 +- .../main/palette/ContainerPreview.java | 2 +- .../decoration/ArcDecorationPainter.java | 24 +-- .../ImageWrapperDecorationPainter.java | 6 +- .../decoration/MatteDecorationPainter.java | 8 +- .../fill/SpecularRectangularFillPainter.java | 4 +- .../theming/api/palette/ColorSchemeUtils.java | 44 ++--- .../api/palette/ContainerColorTokens.java | 12 +- .../ContainerColorTokensSingleColorQuery.java | 10 +- .../PaletteContainerColorsResolver.java | 10 +- .../api/palette/PaletteResolverUtils.java | 180 +++++++++--------- .../blade/BladeContainerColorTokens.java | 12 +- .../internal/blade/BladeIconUtils.java | 8 +- .../theming/internal/blade/BladeUtils.java | 72 +++---- .../painter/SeparatorPainterUtils.java | 2 +- .../internal/ui/RadianceScrollBarUI.java | 4 +- .../utils/ButtonBackgroundDelegate.java | 2 +- .../utils/RadianceColorUtilities.java | 8 +- .../utils/border/RadiancePaneBorder.java | 8 +- .../utils/filters/TonalContainerFilter.java | 20 +- 21 files changed, 224 insertions(+), 224 deletions(-) diff --git a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/check/FakeAccordion.java b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/check/FakeAccordion.java index 7eb707bd2..d519f0514 100644 --- a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/check/FakeAccordion.java +++ b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/check/FakeAccordion.java @@ -92,7 +92,7 @@ protected void paintComponent(Graphics g) { ExtendedContainerColorTokens colorTokens = skin.getBackgroundExtendedContainerTokens( DecorationPainterUtils.getDecorationType(this)); accentedFill = colorTokens.getBaseContainerTokens() - .getContainerLow(); + .getContainerSurfaceLow(); } else { RadianceThemingSlices.DecorationAreaType decorationAreaType = RadianceThemingCortex.ComponentOrParentChainScope.getDecorationType(this); diff --git a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPalettePreview.java b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPalettePreview.java index 0ee567544..6a92149ce 100644 --- a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPalettePreview.java +++ b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPalettePreview.java @@ -58,15 +58,15 @@ public void paint(Graphics g) { int xOffset = 0; // Container colors - paintSquare(g2d, xOffset, height, colorTokens.getContainerLowest()); + paintSquare(g2d, xOffset, height, colorTokens.getContainerSurfaceLowest()); xOffset += (height + smallGap); - paintSquare(g2d, xOffset, height, colorTokens.getContainerLow()); + paintSquare(g2d, xOffset, height, colorTokens.getContainerSurfaceLow()); xOffset += (height + smallGap); - paintSquare(g2d, xOffset, height, colorTokens.getContainer()); + paintSquare(g2d, xOffset, height, colorTokens.getContainerSurface()); xOffset += (height + smallGap); - paintSquare(g2d, xOffset, height, colorTokens.getContainerHigh()); + paintSquare(g2d, xOffset, height, colorTokens.getContainerSurfaceHigh()); xOffset += (height + smallGap); - paintSquare(g2d, xOffset, height, colorTokens.getContainerHighest()); + paintSquare(g2d, xOffset, height, colorTokens.getContainerSurfaceHighest()); xOffset += (height + bigGap); diff --git a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPreview.java b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPreview.java index 6d6621ef9..5036915d9 100644 --- a/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPreview.java +++ b/demos/theming-demo/src/main/java/org/pushingpixels/radiance/demo/theming/main/palette/ContainerPreview.java @@ -58,7 +58,7 @@ protected void paintComponent(Graphics g) { int arc = 8; int strokeThickness = 2; - g2d.setColor(colorTokens.getContainer()); + g2d.setColor(colorTokens.getContainerSurface()); g2d.fillRoundRect(strokeThickness, strokeThickness, width - 2 * strokeThickness + 1, height - 2 * strokeThickness + 1, arc, arc); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ArcDecorationPainter.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ArcDecorationPainter.java index 98fe121a5..fbd078091 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ArcDecorationPainter.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ArcDecorationPainter.java @@ -169,9 +169,9 @@ private void paintTitleBackground(Graphics2D original, Component comp, int width LinearGradientPaint gradientTop = new LinearGradientPaint(0, 0, width, 0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] { - containerColorTokens.getContainer(), - isDark ? containerColorTokens.getContainerHighest() : containerColorTokens.getContainerLowest(), - containerColorTokens.getContainer() }, + containerColorTokens.getContainerSurface(), + isDark ? containerColorTokens.getContainerSurfaceHighest() : containerColorTokens.getContainerSurfaceLowest(), + containerColorTokens.getContainerSurface() }, CycleMethod.REPEAT); g2d.setPaint(gradientTop); g2d.fillRect(0, 0, width, height); @@ -187,9 +187,9 @@ private void paintTitleBackground(Graphics2D original, Component comp, int width LinearGradientPaint gradientBottom = new LinearGradientPaint(0, 0, width, 0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] { - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest(), - containerColorTokens.getContainer(), - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest() + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest(), + containerColorTokens.getContainerSurface(), + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest() }, CycleMethod.REPEAT); g2d.setPaint(gradientBottom); @@ -266,9 +266,9 @@ private void paintExtraBackground(Graphics2D graphics, Container parent, Compone -offset.x, 0, -offset.x + pWidth, 0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] { - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest(), - containerColorTokens.getContainer(), - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest() + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest(), + containerColorTokens.getContainerSurface(), + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest() }, CycleMethod.REPEAT); Graphics2D g2d = (Graphics2D) graphics.create(); @@ -328,9 +328,9 @@ public void paintDecorationArea(Graphics2D graphics, Component comp, -offset.x, 0, -offset.x + pWidth, 0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] { - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest(), - containerColorTokens.getContainer(), - isDark ? containerColorTokens.getContainerLowest() : containerColorTokens.getContainerHighest() + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest(), + containerColorTokens.getContainerSurface(), + isDark ? containerColorTokens.getContainerSurfaceLowest() : containerColorTokens.getContainerSurfaceHighest() }, CycleMethod.REPEAT); Graphics2D g2d = (Graphics2D) graphics.create(); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ImageWrapperDecorationPainter.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ImageWrapperDecorationPainter.java index d45517bb4..46b74e0a0 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ImageWrapperDecorationPainter.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/ImageWrapperDecorationPainter.java @@ -121,7 +121,7 @@ private void paintTitleBackground(Graphics2D graphics, Component comp, ExtendedContainerColorTokens tileContainerTokens = skin.getBackgroundExtendedContainerTokens(decorationAreaType); if (this.baseDecorationPainter == null) { - graphics.setColor(tileContainerTokens.getBaseContainerTokens().getContainerHigh()); + graphics.setColor(tileContainerTokens.getBaseContainerTokens().getContainerSurfaceHigh()); graphics.fillRect(0, 0, width, height); } else { this.baseDecorationPainter.paintDecorationArea(graphics, comp, decorationAreaType, @@ -174,7 +174,7 @@ private void paintExtraBackground(Graphics2D graphics, Component comp, this.baseDecorationPainter.paintDecorationArea(graphics, comp, decorationAreaType, width, height, skin); } else { graphics.setColor(tileContainerTokens.getBaseContainerTokens() - .getContainerHigh()); + .getContainerSurfaceHigh()); graphics.fillRect(0, 0, width, height); } Graphics2D temp = (Graphics2D) graphics.create(); @@ -225,7 +225,7 @@ public void paintDecorationArea(Graphics2D graphics, Component comp, contour, colorTokens); } else { graphics.setColor(colorTokens.getBaseContainerTokens() - .getContainerHigh()); + .getContainerSurfaceHigh()); graphics.fill(contour); } Graphics2D temp = (Graphics2D) graphics.create(); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/MatteDecorationPainter.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/MatteDecorationPainter.java index fec313e6c..8978fcbbd 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/MatteDecorationPainter.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/decoration/MatteDecorationPainter.java @@ -169,9 +169,9 @@ protected void fill(Graphics2D graphics, ExtendedContainerColorTokens colorToken // flex - : medium fill Color startColor = colorTokens.getBaseContainerTokens() - .getContainerLowest(); + .getContainerSurfaceLowest(); Color endColor = colorTokens.getBaseContainerTokens() - .getContainer(); + .getContainerSurface(); int gradientHeight = Math.max(FLEX_POINT, height + offsetY); Paint paint = (gradientHeight == FLEX_POINT) ? @@ -218,9 +218,9 @@ public void paintDecorationArea(Graphics2D graphics, Component comp, Point offset = RadianceCoreUtilities.getOffsetInRootPaneCoords(comp); Color startColor = colorTokens.getBaseContainerTokens() - .getContainerHigh(); + .getContainerSurfaceHigh(); Color endColor = colorTokens.getBaseContainerTokens() - .getContainerHighest(); + .getContainerSurfaceHighest(); int gradientHeight = Math.max(FLEX_POINT, comp.getHeight() + offset.y); Paint paint = (gradientHeight == FLEX_POINT) ? diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/fill/SpecularRectangularFillPainter.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/fill/SpecularRectangularFillPainter.java index 7e6994b11..861063d41 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/fill/SpecularRectangularFillPainter.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/painter/fill/SpecularRectangularFillPainter.java @@ -127,8 +127,8 @@ public void paintContourBackground(Graphics g, Component comp, float width, floa if ((shineWidth > 0) && (shineHeight > 0)) { BufferedImage shineImage = getShineImage(comp, contour, - colorTokens.getContainerLowest(), - colorTokens.getContainerLow(), + colorTokens.getContainerSurfaceLowest(), + colorTokens.getContainerSurfaceLow(), this.alpha, shineWidth, shineHeight); Graphics2D graphics = (Graphics2D) g.create(); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ColorSchemeUtils.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ColorSchemeUtils.java index 4f3def1af..23c5de5ae 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ColorSchemeUtils.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ColorSchemeUtils.java @@ -53,28 +53,28 @@ public boolean isDark() { } @Override - public Color getContainerLowest() { - return tonalContainerColorResolver.getContainerLowest(dynamicScheme); + public Color getContainerSurfaceLowest() { + return tonalContainerColorResolver.getContainerSurfaceLowest(dynamicScheme); } @Override - public Color getContainerLow() { - return tonalContainerColorResolver.getContainerLow(dynamicScheme); + public Color getContainerSurfaceLow() { + return tonalContainerColorResolver.getContainerSurfaceLow(dynamicScheme); } @Override - public Color getContainer() { - return tonalContainerColorResolver.getContainer(dynamicScheme); + public Color getContainerSurface() { + return tonalContainerColorResolver.getContainerSurface(dynamicScheme); } @Override - public Color getContainerHigh() { - return tonalContainerColorResolver.getContainerHigh(dynamicScheme); + public Color getContainerSurfaceHigh() { + return tonalContainerColorResolver.getContainerSurfaceHigh(dynamicScheme); } @Override - public Color getContainerHighest() { - return tonalContainerColorResolver.getContainerHighest(dynamicScheme); + public Color getContainerSurfaceHighest() { + return tonalContainerColorResolver.getContainerSurfaceHighest(dynamicScheme); } @Override @@ -98,7 +98,7 @@ public Color getContainerOutlineVariant() { } @Override - public float getContainerDisabledAlpha() { + public float getContainerSurfaceDisabledAlpha() { return 0.3f; } @@ -507,15 +507,15 @@ private static ContainerColorTokens overlay(ContainerColorTokens original, // Apply overlay on the container tokens Color containerLowest = RadianceColorUtilities.overlayColor( - original.getContainerLowest(), overlayWithAlpha); + original.getContainerSurfaceLowest(), overlayWithAlpha); Color containerLow = RadianceColorUtilities.overlayColor( - original.getContainerLow(), overlayWithAlpha); + original.getContainerSurfaceLow(), overlayWithAlpha); Color container = RadianceColorUtilities.overlayColor( - original.getContainer(), overlayWithAlpha); + original.getContainerSurface(), overlayWithAlpha); Color containerHigh = RadianceColorUtilities.overlayColor( - original.getContainerHigh(), overlayWithAlpha); + original.getContainerSurfaceHigh(), overlayWithAlpha); Color containerHighest = RadianceColorUtilities.overlayColor( - original.getContainerHighest(), overlayWithAlpha); + original.getContainerSurfaceHighest(), overlayWithAlpha); // Leave on container and container outline tokens as they are Color onContainer = original.getOnContainer(); @@ -530,27 +530,27 @@ public boolean isDark() { } @Override - public Color getContainerLowest() { + public Color getContainerSurfaceLowest() { return containerLowest; } @Override - public Color getContainerLow() { + public Color getContainerSurfaceLow() { return containerLow; } @Override - public Color getContainer() { + public Color getContainerSurface() { return container; } @Override - public Color getContainerHigh() { + public Color getContainerSurfaceHigh() { return containerHigh; } @Override - public Color getContainerHighest() { + public Color getContainerSurfaceHighest() { return containerHighest; } @@ -575,7 +575,7 @@ public Color getContainerOutlineVariant() { } @Override - public float getContainerDisabledAlpha() { + public float getContainerSurfaceDisabledAlpha() { return 0.4f; } diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokens.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokens.java index 0ae2e6c37..ac7370462 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokens.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokens.java @@ -34,11 +34,11 @@ public interface ContainerColorTokens { boolean isDark(); - Color getContainerLowest(); - Color getContainerLow(); - Color getContainer(); - Color getContainerHigh(); - Color getContainerHighest(); + Color getContainerSurfaceLowest(); + Color getContainerSurfaceLow(); + Color getContainerSurface(); + Color getContainerSurfaceHigh(); + Color getContainerSurfaceHighest(); Color getOnContainer(); Color getOnContainerVariant(); @@ -46,7 +46,7 @@ public interface ContainerColorTokens { Color getContainerOutline(); Color getContainerOutlineVariant(); - float getContainerDisabledAlpha(); + float getContainerSurfaceDisabledAlpha(); float getOnContainerDisabledAlpha(); float getContainerOutlineDisabledAlpha(); } diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokensSingleColorQuery.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokensSingleColorQuery.java index c0924812a..12dddb7d5 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokensSingleColorQuery.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/ContainerColorTokensSingleColorQuery.java @@ -41,15 +41,15 @@ public interface ContainerColorTokensSingleColorQuery { Color query(ContainerColorTokens colorTokens); ContainerColorTokensSingleColorQuery CONTAINER_LOWEST = (colorTokens) -> - colorTokens.getContainerLowest(); + colorTokens.getContainerSurfaceLowest(); ContainerColorTokensSingleColorQuery CONTAINER_LOW = (colorTokens) -> - colorTokens.getContainerLow(); + colorTokens.getContainerSurfaceLow(); ContainerColorTokensSingleColorQuery CONTAINER = (colorTokens) -> - colorTokens.getContainer(); + colorTokens.getContainerSurface(); ContainerColorTokensSingleColorQuery CONTAINER_HIGH = (colorTokens) -> - colorTokens.getContainerHigh(); + colorTokens.getContainerSurfaceHigh(); ContainerColorTokensSingleColorQuery CONTAINER_HIGHEST = (colorTokens) -> - colorTokens.getContainerHighest(); + colorTokens.getContainerSurfaceHighest(); ContainerColorTokensSingleColorQuery CONTAINER_OUTLINE = (colorTokens) -> colorTokens.getContainerOutline(); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteContainerColorsResolver.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteContainerColorsResolver.java index ac8fdb82c..c8c99f3ac 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteContainerColorsResolver.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteContainerColorsResolver.java @@ -34,11 +34,11 @@ import java.awt.*; public interface PaletteContainerColorsResolver { - Color getContainerLowest(DynamicScheme dynamicScheme); - Color getContainerLow(DynamicScheme dynamicScheme); - Color getContainer(DynamicScheme dynamicScheme); - Color getContainerHigh(DynamicScheme dynamicScheme); - Color getContainerHighest(DynamicScheme dynamicScheme); + Color getContainerSurfaceLowest(DynamicScheme dynamicScheme); + Color getContainerSurfaceLow(DynamicScheme dynamicScheme); + Color getContainerSurface(DynamicScheme dynamicScheme); + Color getContainerSurfaceHigh(DynamicScheme dynamicScheme); + Color getContainerSurfaceHighest(DynamicScheme dynamicScheme); Color getOnContainer(DynamicScheme dynamicScheme); Color getOnContainerVariant(DynamicScheme dynamicScheme); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteResolverUtils.java b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteResolverUtils.java index 6b12994f2..48bb53c5f 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteResolverUtils.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/api/palette/PaletteResolverUtils.java @@ -38,28 +38,28 @@ public static PaletteColorResolver getPaletteColorResolver2() { PaletteContainerColorsResolver neutralContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getNeutralContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getNeutralContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getNeutralContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getNeutralContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getNeutralContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getNeutralContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getNeutralContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getNeutralContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getNeutralContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getNeutralContainerSurfaceHighest()); } @Override @@ -86,28 +86,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver mutedContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getMutedContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getMutedContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getMutedContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getMutedContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getMutedContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getMutedContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getMutedContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getMutedContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getMutedContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getMutedContainerSurfaceHighest()); } @Override @@ -134,28 +134,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver tonalContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getTonalContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getTonalContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getTonalContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getTonalContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getTonalContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getTonalContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getTonalContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getTonalContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getTonalContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getTonalContainerSurfaceHighest()); } @Override @@ -182,28 +182,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver primaryContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getPrimaryContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getPrimaryContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getPrimaryContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getPrimaryContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getPrimaryContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getPrimaryContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getPrimaryContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getPrimaryContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getPrimaryContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getPrimaryContainerSurfaceHighest()); } @Override @@ -230,28 +230,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver systemInfoContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemInfoContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemInfoContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemInfoContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemInfoContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemInfoContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemInfoContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemInfoContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemInfoContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemInfoContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemInfoContainerSurfaceHighest()); } @Override @@ -278,28 +278,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver systemWarningContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemWarningContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemWarningContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemWarningContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemWarningContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemWarningContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemWarningContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemWarningContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemWarningContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemWarningContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemWarningContainerSurfaceHighest()); } @Override @@ -326,28 +326,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver systemErrorContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemErrorContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemErrorContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemErrorContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemErrorContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemErrorContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemErrorContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemErrorContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemErrorContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemErrorContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemErrorContainerSurfaceHighest()); } @Override @@ -374,28 +374,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver systemSuccessContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemSuccessContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemSuccessContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemSuccessContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemSuccessContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemSuccessContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemSuccessContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemSuccessContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemSuccessContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemSuccessContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemSuccessContainerSurfaceHighest()); } @Override @@ -422,28 +422,28 @@ public Color getContainerOutlineVariant(DynamicScheme dynamicScheme) { PaletteContainerColorsResolver systemEmergencyContainerResolver = new PaletteContainerColorsResolver() { @Override - public Color getContainerLowest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemEmergencyContainerLowest()); + public Color getContainerSurfaceLowest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemEmergencyContainerSurfaceLowest()); } @Override - public Color getContainerLow(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemEmergencyContainerLow()); + public Color getContainerSurfaceLow(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemEmergencyContainerSurfaceLow()); } @Override - public Color getContainer(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemEmergencyContainer()); + public Color getContainerSurface(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemEmergencyContainerSurface()); } @Override - public Color getContainerHigh(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemEmergencyContainerHigh()); + public Color getContainerSurfaceHigh(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemEmergencyContainerSurfaceHigh()); } @Override - public Color getContainerHighest(DynamicScheme dynamicScheme) { - return new Color(dynamicScheme.getSystemEmergencyContainerHighest()); + public Color getContainerSurfaceHighest(DynamicScheme dynamicScheme) { + return new Color(dynamicScheme.getSystemEmergencyContainerSurfaceHighest()); } @Override diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeContainerColorTokens.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeContainerColorTokens.java index 93de5ddd2..9936739bb 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeContainerColorTokens.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeContainerColorTokens.java @@ -58,27 +58,27 @@ public boolean isDark() { } @Override - public Color getContainerLowest() { + public Color getContainerSurfaceLowest() { return containerLowest; } @Override - public Color getContainerLow() { + public Color getContainerSurfaceLow() { return containerLow; } @Override - public Color getContainer() { + public Color getContainerSurface() { return container; } @Override - public Color getContainerHigh() { + public Color getContainerSurfaceHigh() { return containerHigh; } @Override - public Color getContainerHighest() { + public Color getContainerSurfaceHighest() { return containerHighest; } @@ -102,7 +102,7 @@ public Color getContainerOutlineVariant() { } @Override - public float getContainerDisabledAlpha() { + public float getContainerSurfaceDisabledAlpha() { return this.containerDisabledAlpha; } diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeIconUtils.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeIconUtils.java index 1262e5228..84a6ce4a1 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeIconUtils.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeIconUtils.java @@ -158,7 +158,7 @@ public static void drawTonalCheckBox(Graphics2D g, JComponent component, Radianc cornerRadius, null, 0.0f); float containerAlpha = currentState.isDisabled() - ? colorTokens.getContainerDisabledAlpha() : 1.0f; + ? colorTokens.getContainerSurfaceDisabledAlpha() : 1.0f; graphics1X.setComposite(getAlphaComposite(containerAlpha)); Shape contourFill = RadianceOutlineUtilities.getBaseOutline( component.getComponentOrientation(), @@ -300,7 +300,7 @@ public static void drawTonalRadioButton(Graphics2D g, AbstractButton button, Rad Shape contourOuter = new Ellipse2D.Float(0.0f, 0.0f, contourDim, contourDim); float containerAlpha = currentState.isDisabled() - ? colorTokens.getContainerDisabledAlpha() : 1.0f; + ? colorTokens.getContainerSurfaceDisabledAlpha() : 1.0f; graphics1X.setComposite(getAlphaComposite(containerAlpha)); fillPainter.paintContourBackground(graphics1X, button, contourDim, contourDim, @@ -334,9 +334,9 @@ public static void drawTonalRadioButton(Graphics2D g, AbstractButton button, Rad graphicsForCheckMark.setPaint( new GradientPaint( rc + radius, rc - radius, - colorTokens.getContainerHigh(), + colorTokens.getContainerSurfaceHigh(), rc - radius, rc + radius, - colorTokens.getContainerLow())); + colorTokens.getContainerSurfaceLow())); } graphicsForCheckMark.fill(markOval); graphicsForCheckMark.dispose(); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeUtils.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeUtils.java index 4855f1c89..23a8dd2b4 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeUtils.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/blade/BladeUtils.java @@ -116,24 +116,24 @@ public static void populateModificationAwareColorTokens( component, RadianceThemingSlices.SystemContainerType.EMERGENCY); bladeContainerTokens.containerLowest = RadianceColorUtilities.getInterpolatedColor( - warningColorTokens.getContainerLowest(), - emergencyColorTokens.getContainerLowest(), + warningColorTokens.getContainerSurfaceLowest(), + emergencyColorTokens.getContainerSurfaceLowest(), modificationCyclePosition); bladeContainerTokens.containerLow = RadianceColorUtilities.getInterpolatedColor( - warningColorTokens.getContainerLow(), - emergencyColorTokens.getContainerLow(), + warningColorTokens.getContainerSurfaceLow(), + emergencyColorTokens.getContainerSurfaceLow(), modificationCyclePosition); bladeContainerTokens.container = RadianceColorUtilities.getInterpolatedColor( - warningColorTokens.getContainer(), - emergencyColorTokens.getContainer(), + warningColorTokens.getContainerSurface(), + emergencyColorTokens.getContainerSurface(), modificationCyclePosition); bladeContainerTokens.containerHigh = RadianceColorUtilities.getInterpolatedColor( - warningColorTokens.getContainerHigh(), - emergencyColorTokens.getContainerHigh(), + warningColorTokens.getContainerSurfaceHigh(), + emergencyColorTokens.getContainerSurfaceHigh(), modificationCyclePosition); bladeContainerTokens.containerHighest = RadianceColorUtilities.getInterpolatedColor( - warningColorTokens.getContainerHighest(), - emergencyColorTokens.getContainerHighest(), + warningColorTokens.getContainerSurfaceHighest(), + emergencyColorTokens.getContainerSurfaceHighest(), modificationCyclePosition); bladeContainerTokens.onContainer = RadianceColorUtilities.getInterpolatedColor( @@ -151,8 +151,8 @@ public static void populateModificationAwareColorTokens( modificationCyclePosition); bladeContainerTokens.containerDisabledAlpha = - (1.0f - modificationCyclePosition) * warningColorTokens.getContainerDisabledAlpha() + - modificationCyclePosition * emergencyColorTokens.getContainerDisabledAlpha(); + (1.0f - modificationCyclePosition) * warningColorTokens.getContainerSurfaceDisabledAlpha() + + modificationCyclePosition * emergencyColorTokens.getContainerSurfaceDisabledAlpha(); bladeContainerTokens.onContainerDisabledAlpha = (1.0f - modificationCyclePosition) * warningColorTokens.getOnContainerDisabledAlpha() + modificationCyclePosition * emergencyColorTokens.getOnContainerDisabledAlpha(); @@ -305,16 +305,16 @@ public static void populateColorTokens( ContainerColorTokens currColorTokens = (treatEnabledAsActive && (currState == ComponentState.ENABLED)) ? RadianceColorSchemeUtilities.getActiveContainerTokens(component, currState) : RadianceColorSchemeUtilities.getContainerTokens(component, associationKind, currState, inactiveContainerType); - Color containerLowest = currColorTokens.getContainerLowest(); - Color containerLow = currColorTokens.getContainerLow(); - Color container = currColorTokens.getContainer(); - Color containerHigh = currColorTokens.getContainerHigh(); - Color containerHighest = currColorTokens.getContainerHighest(); + Color containerLowest = currColorTokens.getContainerSurfaceLowest(); + Color containerLow = currColorTokens.getContainerSurfaceLow(); + Color container = currColorTokens.getContainerSurface(); + Color containerHigh = currColorTokens.getContainerSurfaceHigh(); + Color containerHighest = currColorTokens.getContainerSurfaceHighest(); Color onContainer = currColorTokens.getOnContainer(); Color onContainerVariant = currColorTokens.getOnContainerVariant(); Color containerOutline = currColorTokens.getContainerOutline(); Color containerOutlineVariant = currColorTokens.getContainerOutlineVariant(); - float containerDisabledAlpha = currColorTokens.getContainerDisabledAlpha(); + float containerDisabledAlpha = currColorTokens.getContainerSurfaceDisabledAlpha(); float onContainerDisabledAlpha = currColorTokens.getOnContainerDisabledAlpha(); float containerOutlineDisabledAlpha = currColorTokens.getContainerOutlineDisabledAlpha(); @@ -344,15 +344,15 @@ public static void populateColorTokens( // And interpolate the colors containerLowest = RadianceColorUtilities.getInterpolatedColor(containerLowest, - contributionColorTokens.getContainerLowest(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceLowest(), 1.0f - amount); containerLow = RadianceColorUtilities.getInterpolatedColor(containerLow, - contributionColorTokens.getContainerLow(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceLow(), 1.0f - amount); container = RadianceColorUtilities.getInterpolatedColor(container, - contributionColorTokens.getContainer(), 1.0f - amount); + contributionColorTokens.getContainerSurface(), 1.0f - amount); containerHigh = RadianceColorUtilities.getInterpolatedColor(containerHigh, - contributionColorTokens.getContainerHigh(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceHigh(), 1.0f - amount); containerHighest = RadianceColorUtilities.getInterpolatedColor(containerHighest, - contributionColorTokens.getContainerHighest(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceHighest(), 1.0f - amount); onContainer = RadianceColorUtilities.getInterpolatedColor(onContainer, contributionColorTokens.getOnContainer(), 1.0f - amount); onContainerVariant = RadianceColorUtilities.getInterpolatedColor(onContainerVariant, @@ -362,7 +362,7 @@ public static void populateColorTokens( containerOutlineVariant = RadianceColorUtilities.getInterpolatedColor(containerOutlineVariant, contributionColorTokens.getContainerOutlineVariant(), 1.0f - amount); containerDisabledAlpha = (1.0f - amount) * containerDisabledAlpha + - amount * contributionColorTokens.getContainerDisabledAlpha(); + amount * contributionColorTokens.getContainerSurfaceDisabledAlpha(); onContainerDisabledAlpha = (1.0f - amount) * onContainerDisabledAlpha + amount * contributionColorTokens.getOnContainerDisabledAlpha(); containerOutlineDisabledAlpha = (1.0f - amount) * containerOutlineDisabledAlpha + @@ -575,16 +575,16 @@ public static void populateColorTokens( ContainerColorTokens currColorTokens = colorSchemeDelegate.getContainerTokensForCurrentState(currState); - Color containerLowest = currColorTokens.getContainerLowest(); - Color containerLow = currColorTokens.getContainerLow(); - Color container = currColorTokens.getContainer(); - Color containerHigh = currColorTokens.getContainerHigh(); - Color containerHighest = currColorTokens.getContainerHighest(); + Color containerLowest = currColorTokens.getContainerSurfaceLowest(); + Color containerLow = currColorTokens.getContainerSurfaceLow(); + Color container = currColorTokens.getContainerSurface(); + Color containerHigh = currColorTokens.getContainerSurfaceHigh(); + Color containerHighest = currColorTokens.getContainerSurfaceHighest(); Color onContainer = currColorTokens.getOnContainer(); Color onContainerVariant = currColorTokens.getOnContainerVariant(); Color containerOutline = currColorTokens.getContainerOutline(); Color containerOutlineVariant = currColorTokens.getContainerOutlineVariant(); - float containerDisabledAlpha = currColorTokens.getContainerDisabledAlpha(); + float containerDisabledAlpha = currColorTokens.getContainerSurfaceDisabledAlpha(); float onContainerDisabledAlpha = currColorTokens.getOnContainerDisabledAlpha(); float containerOutlineDisabledAlpha = currColorTokens.getContainerOutlineDisabledAlpha(); @@ -614,15 +614,15 @@ public static void populateColorTokens( // And interpolate the colors containerLowest = RadianceColorUtilities.getInterpolatedColor(containerLowest, - contributionColorTokens.getContainerLowest(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceLowest(), 1.0f - amount); containerLow = RadianceColorUtilities.getInterpolatedColor(containerLow, - contributionColorTokens.getContainerLow(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceLow(), 1.0f - amount); container = RadianceColorUtilities.getInterpolatedColor(container, - contributionColorTokens.getContainer(), 1.0f - amount); + contributionColorTokens.getContainerSurface(), 1.0f - amount); containerHigh = RadianceColorUtilities.getInterpolatedColor(containerHigh, - contributionColorTokens.getContainerHigh(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceHigh(), 1.0f - amount); containerHighest = RadianceColorUtilities.getInterpolatedColor(containerHighest, - contributionColorTokens.getContainerHighest(), 1.0f - amount); + contributionColorTokens.getContainerSurfaceHighest(), 1.0f - amount); onContainer = RadianceColorUtilities.getInterpolatedColor(onContainer, contributionColorTokens.getOnContainer(), 1.0f - amount); onContainerVariant = RadianceColorUtilities.getInterpolatedColor(onContainerVariant, @@ -632,7 +632,7 @@ public static void populateColorTokens( containerOutlineVariant = RadianceColorUtilities.getInterpolatedColor(containerOutlineVariant, contributionColorTokens.getContainerOutlineVariant(), 1.0f - amount); containerDisabledAlpha = (1.0f - amount) * containerDisabledAlpha + - amount * contributionColorTokens.getContainerDisabledAlpha(); + amount * contributionColorTokens.getContainerSurfaceDisabledAlpha(); onContainerDisabledAlpha = (1.0f - amount) * onContainerDisabledAlpha + amount * contributionColorTokens.getOnContainerDisabledAlpha(); containerOutlineDisabledAlpha = (1.0f - amount) * containerOutlineDisabledAlpha + diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/painter/SeparatorPainterUtils.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/painter/SeparatorPainterUtils.java index 7e092604b..1d86eb851 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/painter/SeparatorPainterUtils.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/painter/SeparatorPainterUtils.java @@ -459,7 +459,7 @@ public static void paintTonalSeparator(Component c, Graphics g, ? colorTokens.getContainerOutlineVariant() : colorTokens.getContainerOutline(); // TODO: TONAL - verify this across light and dark skins - Color secondary = colorTokens.getContainerLow(); + Color secondary = colorTokens.getContainerSurfaceLow(); System.out.println("Separator in " + decorationAreaType + ": primary=" + RadianceColorUtilities.encode(primary) + ", secondary=" + RadianceColorUtilities.encode(secondary)); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java index d4b4e9d56..731e36c0b 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/ui/RadianceScrollBarUI.java @@ -196,7 +196,7 @@ private void drawThumbVertical(Graphics2D g, Rectangle thumbBounds) { graphics1X.transform(at); float containerAlpha = currState.isDisabled() - ? mutableContainerTokens.getContainerDisabledAlpha() : 1.0f; + ? mutableContainerTokens.getContainerSurfaceDisabledAlpha() : 1.0f; graphics1X.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, containerAlpha)); painter.paintContourBackground(graphics1X, this.scrollbar, scaledWidth, scaledHeight, @@ -290,7 +290,7 @@ private void drawThumbHorizontal(Graphics2D g, Rectangle thumbBounds) { graphics1X.translate(x, y + voffset * scaleFactor); float containerAlpha = currState.isDisabled() - ? mutableContainerTokens.getContainerDisabledAlpha() : 1.0f; + ? mutableContainerTokens.getContainerSurfaceDisabledAlpha() : 1.0f; graphics1X.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, containerAlpha)); painter.paintContourBackground(graphics1X, this.scrollbar, scaledWidth, scaledHeight, diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/ButtonBackgroundDelegate.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/ButtonBackgroundDelegate.java index 6f850bac2..71e741677 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/ButtonBackgroundDelegate.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/ButtonBackgroundDelegate.java @@ -321,7 +321,7 @@ private void drawTonalBackground(Graphics2D g, AbstractButton button, RadianceBu scaledHeight + deltaTop + deltaBottom + 1.0f, scaleFactor, false) : contourOuter; float containerAlpha = overallAlpha * - (currState.isDisabled() ? colorTokens.getContainerDisabledAlpha() : 1.0f); + (currState.isDisabled() ? colorTokens.getContainerSurfaceDisabledAlpha() : 1.0f); graphics1X.setComposite(WidgetUtilities.getAlphaComposite(button, overallAlpha * containerAlpha, g)); fillPainter.paintContourBackground(graphics1X, button, diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java index 6d934ddbe..d2033a783 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/RadianceColorUtilities.java @@ -811,7 +811,7 @@ public static Color getTonalBackgroundFillColor(Component component, && component.isEnabled()) { return backgr; } - backgr = colorTokens.getContainer(); + backgr = colorTokens.getContainerSurface(); } else { ComponentState state = component.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED; @@ -836,7 +836,7 @@ public static Color getTonalBackgroundFillColor(Component component, } backgr = RadianceColorUtilities.getDefaultTonalBackgroundColor(component, state); - float alpha = state.isDisabled() ? colorTokens.getContainerDisabledAlpha() : 1.0f; + float alpha = state.isDisabled() ? colorTokens.getContainerSurfaceDisabledAlpha() : 1.0f; if (alpha < 1.0f) { Color defaultColor = RadianceColorUtilities .getDefaultTonalBackgroundColor(component, ComponentState.ENABLED); @@ -859,7 +859,7 @@ public static Color getBackgroundTonalFillColorScrollBar(JScrollBar scrollbar) { scrollbar, scrollbar.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED, RadianceThemingSlices.ContainerType.NEUTRAL); - return colorTokens.getContainer(); + return colorTokens.getContainerSurface(); } /** @@ -915,7 +915,7 @@ public static Color getStripedBackground(JComponent component, int rowIndex) { component.isEnabled() ? ComponentState.ENABLED : ComponentState.DISABLED_UNSELECTED, RadianceThemingSlices.ContainerType.NEUTRAL); return (rowIndex % 2 == 0) ? colorTokens.getSurface() - : colorTokens.getBaseContainerTokens().getContainerLow(); + : colorTokens.getBaseContainerTokens().getContainerSurfaceLow(); } else { RadianceColorScheme scheme = skin.getBackgroundColorScheme( DecorationPainterUtils.getDecorationType(component)); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/border/RadiancePaneBorder.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/border/RadiancePaneBorder.java index 5826d3b06..b5aea6bc0 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/border/RadiancePaneBorder.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/border/RadiancePaneBorder.java @@ -95,8 +95,8 @@ public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { // primary inner outline graphics.setColor(isDark - ? titleContainerTokens.getContainerHigh() - : titleContainerTokens.getContainer()); + ? titleContainerTokens.getContainerSurfaceHigh() + : titleContainerTokens.getContainerSurface()); graphics.drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2); graphics.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); graphics.drawLine(x + 1, y + 1, x + w - 3, y + 1); @@ -104,8 +104,8 @@ public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { // secondary inner outline graphics.setColor(isDark - ? titleContainerTokens.getContainerHighest() - : titleContainerTokens.getContainerLowest()); + ? titleContainerTokens.getContainerSurfaceHighest() + : titleContainerTokens.getContainerSurfaceLowest()); graphics.drawRect(x + 2, y + 2, w - 5, h - 5); graphics.drawRect(x + 3, y + 3, w - 7, h - 7); graphics.drawRect(x + 4, y + 4, w - 9, h - 9); diff --git a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/filters/TonalContainerFilter.java b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/filters/TonalContainerFilter.java index 5613cc4d2..bcf196488 100644 --- a/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/filters/TonalContainerFilter.java +++ b/theming/src/main/java/org/pushingpixels/radiance/theming/internal/utils/filters/TonalContainerFilter.java @@ -79,29 +79,29 @@ public static int[] getInterpolatedColors(ContainerColorTokens colorTokens) { // collect the brightness factors of the color tokens Map tokenColorMapping = new TreeMap<>(); - int containerLowest = colorTokens.getContainerLowest().getRGB(); - int containerLow = colorTokens.getContainerLow().getRGB(); - int container = colorTokens.getContainer().getRGB(); - int containerHigh = colorTokens.getContainerHigh().getRGB(); - int containerHighest = colorTokens.getContainerHighest().getRGB(); + int containerLowest = colorTokens.getContainerSurfaceLowest().getRGB(); + int containerLow = colorTokens.getContainerSurfaceLow().getRGB(); + int container = colorTokens.getContainerSurface().getRGB(); + int containerHigh = colorTokens.getContainerSurfaceHigh().getRGB(); + int containerHighest = colorTokens.getContainerSurfaceHighest().getRGB(); int onContainerVariant = colorTokens.getOnContainerVariant().getRGB(); int onContainer = colorTokens.getOnContainer().getRGB(); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(containerLowest), - colorTokens.getContainerLowest()); + colorTokens.getContainerSurfaceLowest()); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(containerLow), - colorTokens.getContainerLow()); + colorTokens.getContainerSurfaceLow()); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(container), - colorTokens.getContainer()); + colorTokens.getContainerSurface()); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(containerHigh), - colorTokens.getContainerHigh()); + colorTokens.getContainerSurfaceHigh()); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(containerHighest), - colorTokens.getContainerHighest()); + colorTokens.getContainerSurfaceHighest()); tokenColorMapping.put( RadianceColorUtilities.getColorBrightness(onContainerVariant), colorTokens.getOnContainerVariant());