Skip to content

Commit

Permalink
Second pass for tonal Business
Browse files Browse the repository at this point in the history
* Add Business Blue Steel
* Polish the colors of Business

For #400
  • Loading branch information
kirill-grouchnikov committed Dec 12, 2024
1 parent d4790d2 commit 81ed925
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.pushingpixels.radiance.demo.theming.main.Check;
import org.pushingpixels.radiance.theming.api.RadianceSkin;
import org.pushingpixels.radiance.theming.api.RadianceThemingCortex;
import org.pushingpixels.radiance.theming.api.skin.BusinessSkin;
import org.pushingpixels.radiance.theming.api.skin.BusinessBlueSteelSkin;

import javax.swing.*;
import java.awt.*;
Expand All @@ -41,7 +41,7 @@

public class TonalCheck {
public static void main(String[] args) {
RadianceSkin tonalSkin = new BusinessSkin.BusinessTonalSkin();
RadianceSkin tonalSkin = new BusinessBlueSteelSkin.BusinessBlueSteelTonalSkin();
//new ControlStates.SampleSkin(new AquaColorScheme());

RadianceThemingCortex.GlobalScope.registerWidget("org.pushingpixels.radiance.theming" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public RadianceColorScheme getWindowChromeAccent() {
public static abstract class TonalAccented extends RadianceSkin implements TonalSkin {
public final static class AccentBuilder {
private RadianceColorScheme2 windowChromeAccent;
private RadianceColorScheme2 windowChromeHighlightsAccent;
private RadianceColorScheme2 enabledControlsAccent;
private RadianceColorScheme2 activeControlsAccent;
private RadianceColorScheme2 highlightsAccent;
Expand All @@ -206,6 +207,11 @@ public AccentBuilder withWindowChromeAccent(RadianceColorScheme2 windowChromeAcc
return this;
}

public AccentBuilder withWindowChromeHighlightsAccent(RadianceColorScheme2 windowChromeHighlightsAccent) {
this.windowChromeHighlightsAccent = windowChromeHighlightsAccent;
return this;
}

public AccentBuilder withActiveControlsAccent(RadianceColorScheme2 activeControlsAccent) {
this.activeControlsAccent = activeControlsAccent;
return this;
Expand All @@ -228,13 +234,15 @@ public AccentBuilder withBackgroundAccent(RadianceColorScheme2 backgroundAccent)
}

private final RadianceColorScheme2 windowChromeAccent;
private final RadianceColorScheme2 windowChromeHighlightsAccent;
private final RadianceColorScheme2 activeControlsAccent;
private final RadianceColorScheme2 enabledControlsAccent;
private final RadianceColorScheme2 highlightsAccent;
private final RadianceColorScheme2 backgroundAccent;

protected TonalAccented(AccentBuilder accentBuilder) {
this.windowChromeAccent = accentBuilder.windowChromeAccent;
this.windowChromeHighlightsAccent = accentBuilder.windowChromeHighlightsAccent;
this.activeControlsAccent = accentBuilder.activeControlsAccent;
this.enabledControlsAccent = accentBuilder.enabledControlsAccent;
this.highlightsAccent = accentBuilder.highlightsAccent;
Expand All @@ -260,6 +268,10 @@ public RadianceColorScheme2 getHighlightsAccent() {
public RadianceColorScheme2 getWindowChromeAccent() {
return this.windowChromeAccent;
}

public RadianceColorScheme2 getWindowChromeHighlightsAccent() {
return this.windowChromeHighlightsAccent;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,18 @@ protected BusinessAccentedTonalSkin(AccentBuilder accentBuilder) {
businessDefaultBundle.getMainColorScheme().getExtendedTonalContainerTokens(),
RadianceThemingSlices.DecorationAreaType.NONE);

this.registerAsDecorationArea(this.getWindowChromeAccent().getExtendedTonalContainerTokens(),
RadianceColorSchemeBundle2 businessDefaultHeaderBundle =
new RadianceColorSchemeBundle2(this.getWindowChromeAccent());
if (this.getWindowChromeHighlightsAccent() != null) {
businessDefaultHeaderBundle.registerColorScheme(this.getWindowChromeHighlightsAccent(),
RadianceThemingSlices.ContainerColorTokensAssociationKind.HIGHLIGHT,
ComponentState.getActiveStates());
}
this.registerDecorationAreaSchemeBundle(businessDefaultHeaderBundle,
businessDefaultHeaderBundle.getMainColorScheme().getExtendedTonalContainerTokens(),
RadianceThemingSlices.DecorationAreaType.PRIMARY_TITLE_PANE,
RadianceThemingSlices.DecorationAreaType.SECONDARY_TITLE_PANE,
RadianceThemingSlices.DecorationAreaType.HEADER,
RadianceThemingSlices.DecorationAreaType.FOOTER);
RadianceThemingSlices.DecorationAreaType.HEADER);

RadianceColorScheme2 controlPaneColorScheme =
ColorSchemeUtils.getLightTonalBalancedColorScheme(Hct.fromInt(0xFFDBDFE4), 3.0, 1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
*/
package org.pushingpixels.radiance.theming.api.skin;

import org.pushingpixels.radiance.theming.api.ComponentState;
import org.pushingpixels.radiance.theming.api.RadianceColorSchemeBundle;
import org.pushingpixels.radiance.theming.api.RadianceThemingSlices;
import org.pushingpixels.radiance.theming.api.RadianceSkin;
import org.pushingpixels.ephemeral.chroma.hct.Hct;
import org.pushingpixels.radiance.theming.api.*;
import org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme;
import org.pushingpixels.radiance.theming.api.palette.ColorSchemeUtils;
import org.pushingpixels.radiance.theming.api.palette.RadianceColorScheme2;

/**
* <code>Business Blue Steel</code> skin. This class is part of officially supported API.
Expand Down Expand Up @@ -92,4 +92,41 @@ public BusinessBlueSteelSkin() {
public String getDisplayName() {
return NAME;
}

public static class BusinessBlueSteelTonalSkin extends BusinessAccentedTonalSkin {
public static final String NAME = "Business Blue Steel Tonal";

public BusinessBlueSteelTonalSkin() {
super(new AccentBuilder()
.withWindowChromeAccent(ColorSchemeUtils.getLightTonalFidelityColorScheme(
Hct.fromInt(0xFFA1BCD0), Hct.fromInt(0xFFC4C8CC), Hct.fromInt(0xFFEAEAF0)))
.withWindowChromeHighlightsAccent(ColorSchemeUtils.getLightTonalFidelityColorScheme(
Hct.fromInt(0xFF83AFCE), Hct.fromInt(0xFFC4C8CC), Hct.fromInt(0xFFEAEAF0)))
.withActiveControlsAccent(ColorSchemeUtils.getLightTonalFidelityColorScheme(
Hct.fromInt(0xFF98B7CC), Hct.fromInt(0xFFC4C8CC), Hct.fromInt(0xFFEAEAF0)))
.withHighlightsAccent(ColorSchemeUtils.getLightTonalBalancedColorScheme(
Hct.fromInt(0xFFEBD296), 5.0, 2.0)));

RadianceColorScheme2 controlPaneColorScheme =
ColorSchemeUtils.getLightTonalFidelityColorScheme(Hct.fromInt(0xFF94B9D3),
Hct.fromInt(0xFFBFCFDB), Hct.fromInt(0xFFBFCFDB));

RadianceColorSchemeBundle2 businessBlueSteelControlBundle =
new RadianceColorSchemeBundle2(controlPaneColorScheme);
businessBlueSteelControlBundle.registerColorScheme(
getActiveControlsAccent(),
RadianceThemingSlices.ContainerColorTokensAssociationKind.HIGHLIGHT,
ComponentState.getActiveStates());
this.registerDecorationAreaSchemeBundle(businessBlueSteelControlBundle,
controlPaneColorScheme.getExtendedMutedContainerTokens(),
RadianceThemingSlices.DecorationAreaType.CONTROL_PANE,
RadianceThemingSlices.DecorationAreaType.FOOTER);
}

@Override
public String getDisplayName() {
return NAME;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ public static class BusinessTonalSkin extends BusinessAccentedTonalSkin {
public BusinessTonalSkin() {
super(new AccentBuilder()
.withWindowChromeAccent(ColorSchemeUtils.getLightTonalFidelityColorScheme(
Hct.fromInt(0xFFB9C4CE), Hct.fromInt(0xFFDEDDDF), Hct.fromInt(0xFFF9F9F9)))
Hct.fromInt(0xFFBDC8D3), Hct.fromInt(0xFFDEDDDF), Hct.fromInt(0xFFE4EAF0)))
.withWindowChromeHighlightsAccent(ColorSchemeUtils.getLightTonalBalancedColorScheme(
Hct.fromInt(0xFFEBD296), 5.0, 2.0))
.withActiveControlsAccent(ColorSchemeUtils.getLightTonalFidelityColorScheme(
Hct.fromInt(0xFFEAEDF3), Hct.fromInt(0xFFDEDDDF), Hct.fromInt(0xFFF9F9F9)))
Hct.fromInt(0xFFEAEDF3), Hct.fromInt(0xFFDEDDDF), Hct.fromInt(0xFFEAEAF0)))
.withHighlightsAccent(ColorSchemeUtils.getLightTonalBalancedColorScheme(
Hct.fromInt(0xFFEBD296), 5.0, 2.0)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ public class RadianceBusinessBlueSteelLookAndFeel extends RadianceLookAndFeel {
public RadianceBusinessBlueSteelLookAndFeel() {
super(new BusinessBlueSteelSkin());
}

public static class RadianceBusinessBlueSteelTonalLookAndFeel extends RadianceLookAndFeel {
public RadianceBusinessBlueSteelTonalLookAndFeel() {
super(new BusinessBlueSteelSkin.BusinessBlueSteelTonalSkin());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public Set<SkinInfo> getSkins() {
RadianceModerateLookAndFeel.RadianceModerateTonalLookAndFeel.class::getName));
result.add(new SkinInfo(BusinessSkin.BusinessTonalSkin.NAME, BusinessSkin.BusinessTonalSkin.class::getName,
RadianceBusinessLookAndFeel.RadianceBusinessTonalLookAndFeel.class::getName));
result.add(new SkinInfo(BusinessBlueSteelSkin.BusinessBlueSteelTonalSkin.NAME,
BusinessBlueSteelSkin.BusinessBlueSteelTonalSkin.class::getName,
RadianceBusinessBlueSteelLookAndFeel.RadianceBusinessBlueSteelTonalLookAndFeel.class::getName));

return result;
}
Expand Down

0 comments on commit 81ed925

Please sign in to comment.