Class RadianceColorSchemeUtilities
- java.lang.Object
-
- org.pushingpixels.radiance.theming.internal.utils.RadianceColorSchemeUtilities
-
public class RadianceColorSchemeUtilities extends java.lang.Object
Utilities related to color schemes. This class is for internal use only.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RadianceColorSchemeUtilities.ColorSchemeKind
-
Field Summary
Fields Modifier and Type Field Description static RadianceColorScheme
GREEN
Used as reference to the green color scheme.static RadianceColorScheme
ORANGE
Used as reference in attention-drawing animations.private static LazyResettableHashMap<RadianceColorScheme>
shiftedCache
Cache of shifted schemes.static RadianceColorScheme
YELLOW
Used as reference in attention-drawing animations.
-
Constructor Summary
Constructors Constructor Description RadianceColorSchemeUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.awt.Color
decodeColor(java.lang.String value, java.util.Map<java.lang.String,java.awt.Color> colorMap)
static RadianceColorScheme
getActiveColorScheme(java.awt.Component component, ComponentState componentState)
Returns the active color scheme of the component.static float
getAlpha(java.awt.Component component, ComponentState componentState)
Returns the alpha channel of the color scheme of the component.private static RadianceColorScheme
getColorizedScheme(java.awt.Component component, RadianceColorScheme scheme, boolean isEnabled)
Returns a colorized version of the specified color scheme.private static RadianceColorScheme
getColorizedScheme(java.awt.Component component, RadianceColorScheme scheme, java.awt.Color fgColor, java.awt.Color bgColor, boolean isEnabled)
Returns a colorized version of the specified color scheme.static RadianceColorScheme
getColorScheme(java.awt.Component component, ComponentState componentState)
Returns the color scheme of the specified component.static RadianceColorScheme
getColorScheme(java.awt.Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme of the component.static RadianceColorScheme
getColorScheme(javax.swing.JTabbedPane jtp, int tabIndex, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme of the specified tabbed pane tab.static RadianceSkin.ColorSchemes
getColorSchemes(java.io.InputStream inputStream)
static RadianceColorScheme
getDarkColorScheme(java.lang.String name, java.awt.Color[] colors, java.util.Map<java.lang.String,java.awt.Color> additionalColors)
static RadianceColorScheme
getDirectColorScheme(java.awt.Component component, RadianceThemingSlices.ColorSchemeAssociationKind associationKind, ComponentState componentState)
Returns the color scheme of the component.static float
getHighlightAlpha(java.awt.Component component, ComponentState componentState)
Returns the alpha channel of the highlight color scheme of the component.static RadianceColorScheme
getLightColorScheme(java.lang.String name, java.awt.Color[] colors, java.util.Map<java.lang.String,java.awt.Color> additionalColors)
static RadianceColorScheme
getShiftedScheme(RadianceColorScheme orig, java.awt.Color backgroundShiftColor, double backgroundShiftFactor, java.awt.Color foregroundShiftColor, double foregroundShiftFactor)
Returns a shifted color scheme.
-
-
-
Field Detail
-
shiftedCache
private static final LazyResettableHashMap<RadianceColorScheme> shiftedCache
Cache of shifted schemes.
-
YELLOW
public static final RadianceColorScheme YELLOW
Used as reference in attention-drawing animations. This field is for internal use only.
-
ORANGE
public static final RadianceColorScheme ORANGE
Used as reference in attention-drawing animations. This field is for internal use only.
-
GREEN
public static final RadianceColorScheme GREEN
Used as reference to the green color scheme. This field is for internal use only.
-
-
Method Detail
-
getColorizedScheme
private static RadianceColorScheme getColorizedScheme(java.awt.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(java.awt.Component component, RadianceColorScheme scheme, java.awt.Color fgColor, java.awt.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(javax.swing.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(java.awt.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(java.awt.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(java.awt.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(java.awt.Component component, ComponentState componentState)
Returns the active color scheme of the component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Component color scheme.
-
getHighlightAlpha
public static float getHighlightAlpha(java.awt.Component component, ComponentState componentState)
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
public static float getAlpha(java.awt.Component component, ComponentState componentState)
Returns the alpha channel of the color scheme of the component.- Parameters:
component
- Component.componentState
- Component state.- Returns:
- Color scheme alpha channel.
-
getLightColorScheme
public static RadianceColorScheme getLightColorScheme(java.lang.String name, java.awt.Color[] colors, java.util.Map<java.lang.String,java.awt.Color> additionalColors)
-
getDarkColorScheme
public static RadianceColorScheme getDarkColorScheme(java.lang.String name, java.awt.Color[] colors, java.util.Map<java.lang.String,java.awt.Color> additionalColors)
-
decodeColor
private static java.awt.Color decodeColor(java.lang.String value, java.util.Map<java.lang.String,java.awt.Color> colorMap)
-
getColorSchemes
public static RadianceSkin.ColorSchemes getColorSchemes(java.io.InputStream inputStream)
-
getShiftedScheme
public static RadianceColorScheme getShiftedScheme(RadianceColorScheme orig, java.awt.Color backgroundShiftColor, double backgroundShiftFactor, java.awt.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.
-
-