Class CoreColorTokenUtils
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.CoreColorTokenUtils
Utilities related to color tokens. This class is for internal use only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of available container types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LazyResettableHashMap<ContainerColorTokens> Cache of blended tokens. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ContainerColorTokensblendTowards(ContainerColorTokens original, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) static ContainerColorTokensgetActiveContainerTokens(Component component) Returns the active color tokens of the component.static ContainerColorTokensgetActiveContainerTokens(Component component, ComponentState componentState) private static ContainerColorTokensgetBlendedTokens(Component component, ContainerColorTokens tokens, boolean isEnabled) private static ContainerColorTokensgetBlendedTokens(Component component, ContainerColorTokens tokens, Color fgColor, Color bgColor, boolean isEnabled) static ContainerColorTokensgetBlendedTokens(ContainerColorTokens original, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) static ContainerColorTokensgetContainerTokens(Component component, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType) static ContainerColorTokensgetContainerTokens(Component component, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType) Returns the color tokens of the component.static ContainerColorTokensgetContainerTokens(Component component, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType, boolean skipFlatCheck) Returns the color tokens of the component.static ContainerColorTokensgetContainerTokens(JTabbedPane jtp, int tabIndex, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns the color tokens of the specified tabbed pane tab.static ContainerColorTokensgetPressedSelectedTokens(ContainerColorTokens baseTokens) static ContainerColorTokensgetPressedUnselectedTokens(ContainerColorTokens baseTokens) static ContainerColorTokensgetRolloverArmedTokens(ContainerColorTokens baseTokens) static ContainerColorTokensgetRolloverSelectedTokens(ContainerColorTokens baseTokens) static ContainerColorTokensgetRolloverUnselectedTokens(ContainerColorTokens baseTokens) private static ContainerColorTokensoverlay(ContainerColorTokens original, Color overlay, float overlayAmount)
-
Field Details
-
blendedCache
Cache of blended tokens.
-
-
Constructor Details
-
CoreColorTokenUtils
public CoreColorTokenUtils()
-
-
Method Details
-
getContainerTokens
public static ContainerColorTokens getContainerTokens(JTabbedPane jtp, int tabIndex, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState) Returns the color tokens of the specified tabbed pane tab.- Parameters:
jtp- Tabbed pane.tabIndex- Tab index.componentState- Tab component state.- Returns:
- The color tokens of the specified tabbed pane tab.
-
getContainerTokens
public static ContainerColorTokens getContainerTokens(Component component, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType) -
getContainerTokens
public static ContainerColorTokens getContainerTokens(Component component, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType) Returns the color tokens of the component.- Parameters:
component- Component.associationKind- Association kind.componentState- Component state.- Returns:
- Component color tokens.
-
getContainerTokens
public static ContainerColorTokens getContainerTokens(Component component, RadianceThemingSlices.ContainerColorTokensAssociationKind associationKind, ComponentState componentState, CoreColorTokenUtils.ContainerType inactiveContainerType, boolean skipFlatCheck) Returns the color tokens of the component.- Parameters:
component- Component.associationKind- Association kind.componentState- Component state.- Returns:
- Component color tokens.
-
getActiveContainerTokens
Returns the active color tokens of the component.- Parameters:
component- Component.- Returns:
- Component color tokens.
-
getActiveContainerTokens
public static ContainerColorTokens getActiveContainerTokens(Component component, ComponentState componentState) -
getRolloverUnselectedTokens
-
getRolloverSelectedTokens
-
getRolloverArmedTokens
-
getPressedUnselectedTokens
-
getPressedSelectedTokens
-
overlay
private static ContainerColorTokens overlay(ContainerColorTokens original, Color overlay, float overlayAmount) -
getBlendedTokens
private static ContainerColorTokens getBlendedTokens(Component component, ContainerColorTokens tokens, boolean isEnabled) -
getBlendedTokens
private static ContainerColorTokens getBlendedTokens(Component component, ContainerColorTokens tokens, Color fgColor, Color bgColor, boolean isEnabled) -
getBlendedTokens
public static ContainerColorTokens getBlendedTokens(ContainerColorTokens original, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) -
blendTowards
private static ContainerColorTokens blendTowards(ContainerColorTokens original, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor)
-