Class RadianceColorSchemeUtilities
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.RadianceColorSchemeUtilities
Utilities related to color schemes. This class is for internal use only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RadianceColorScheme
Used as reference to the green color scheme.static final RadianceColorScheme
Used as reference in attention-drawing animations.private static final LazyResettableHashMap
<RadianceColorScheme> Cache of shifted schemes.static final RadianceColorScheme
Used as reference in attention-drawing animations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Color
decodeColor
(String value, Map<String, Color> colorMap) static RadianceColorScheme
getActiveColorScheme
(Component component, ComponentState componentState) Returns the active color scheme of the component.static float
getAlpha
(Component component, ComponentState componentState) Returns the alpha channel of the color scheme of the component.private static RadianceColorScheme
getColorizedScheme
(Component component, RadianceColorScheme scheme, boolean isEnabled) Returns a colorized version of the specified color scheme.private static RadianceColorScheme
getColorizedScheme
(Component component, RadianceColorScheme scheme, Color fgColor, Color bgColor, boolean isEnabled) Returns a colorized version of the specified color scheme.static RadianceColorScheme
getColorScheme
(Component component, ComponentState componentState) Returns the color scheme of the specified component.static RadianceColorScheme
getColorScheme
(Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the component.static RadianceColorScheme
getColorScheme
(JTabbedPane jtp, int tabIndex, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the specified tabbed pane tab.static RadianceSkin.ColorSchemes
getColorSchemes
(InputStream inputStream) static RadianceColorScheme
static RadianceColorScheme
getDirectColorScheme
(Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the component.static float
getHighlightAlpha
(Component component, ComponentState componentState) Returns the alpha channel of the highlight color scheme of the component.static RadianceColorScheme
static RadianceColorScheme
getShiftedScheme
(RadianceColorScheme orig, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Returns a shifted color scheme.
-
Field Details
-
shiftedCache
Cache of shifted schemes. -
YELLOW
Used as reference in attention-drawing animations. This field is for internal use only. -
ORANGE
Used as reference in attention-drawing animations. This field is for internal use only. -
GREEN
Used as reference to the green color scheme. This field is for internal use only.
-
-
Constructor Details
-
RadianceColorSchemeUtilities
public RadianceColorSchemeUtilities()
-
-
Method Details
-
getColorizedScheme
private static RadianceColorScheme getColorizedScheme(Component component, RadianceColorScheme scheme, boolean isEnabled) Returns a colorized version of the specified color scheme.- Parameters:
component
- Component.scheme
- Color scheme.isEnabled
- Indicates whether the component is enabled.- Returns:
- Colorized version of the specified color scheme.
-
getColorizedScheme
private static RadianceColorScheme getColorizedScheme(Component component, RadianceColorScheme scheme, Color fgColor, Color bgColor, boolean isEnabled) Returns a colorized version of the specified color scheme.- Parameters:
component
- Component.scheme
- Color scheme.isEnabled
- Indicates whether the component is enabled.- Returns:
- Colorized version of the specified color scheme.
-
getColorScheme
public static RadianceColorScheme getColorScheme(JTabbedPane jtp, int tabIndex, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the specified tabbed pane tab.- Parameters:
jtp
- Tabbed pane.tabIndex
- Tab index.componentState
- Tab component state.- Returns:
- The color scheme of the specified tabbed pane tab.
-
getColorScheme
public static RadianceColorScheme getColorScheme(Component component, ComponentState componentState) Returns the color scheme of the specified component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Component color scheme.
-
getColorScheme
public static RadianceColorScheme getColorScheme(Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the component.- Parameters:
component
- Component.associationKind
- Association kind.componentState
- Component state.- Returns:
- Component color scheme.
-
getDirectColorScheme
public static RadianceColorScheme getDirectColorScheme(Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState) Returns the color scheme of the component.- Parameters:
component
- Component.associationKind
- Association kind.componentState
- Component state.- Returns:
- Component color scheme.
-
getActiveColorScheme
public static RadianceColorScheme getActiveColorScheme(Component component, ComponentState componentState) Returns the active color scheme of the component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Component color scheme.
-
getHighlightAlpha
Returns the alpha channel of the highlight color scheme of the component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Highlight color scheme alpha channel.
-
getAlpha
Returns the alpha channel of the color scheme of the component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Color scheme alpha channel.
-
getLightColorScheme
-
getDarkColorScheme
-
decodeColor
-
getColorSchemes
-
getShiftedScheme
public static RadianceColorScheme getShiftedScheme(RadianceColorScheme orig, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Returns a shifted color scheme. This method is for internal use only.- Parameters:
orig
- The original color scheme.backgroundShiftColor
- Shift color for the background color scheme colors. May benull
- in this case, the background color scheme colors will not be shifted.backgroundShiftFactor
- Shift factor for the background color scheme colors. If the shift color for the background color scheme colors isnull
, this value is ignored.foregroundShiftColor
- Shift color for the foreground color scheme colors. May benull
- in this case, the foreground color scheme colors will not be shifted.foregroundShiftFactor
- Shift factor for the foreground color scheme colors. If the shift color for the foreground color scheme colors isnull
, this value is ignored.- Returns:
- Shifted scheme.
-