Class RadianceColorSchemeUtilities

java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.RadianceColorSchemeUtilities

public class RadianceColorSchemeUtilities extends Object
Utilities related to color schemes. This class is for internal use only.
  • Field Details

    • 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.
  • 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

      public static float getHighlightAlpha(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(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(String name, Color[] colors, Map<String,Color> additionalColors)
    • getDarkColorScheme

      public static RadianceColorScheme getDarkColorScheme(String name, Color[] colors, Map<String,Color> additionalColors)
    • decodeColor

      private static Color decodeColor(String value, Map<String,Color> colorMap)
    • getColorSchemes

      public static RadianceSkin.ColorSchemes getColorSchemes(InputStream inputStream)
    • 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 be null - 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 is null, this value is ignored.
      foregroundShiftColor - Shift color for the foreground color scheme colors. May be null - 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 is null, this value is ignored.
      Returns:
      Shifted scheme.