java.lang.Object
org.pushingpixels.radiance.theming.api.colorscheme.BaseColorScheme
All Implemented Interfaces:
RadianceColorScheme, SchemeBaseColors, SchemeDerivedColors, RadianceTrait
Direct Known Subclasses:
BaseDarkColorScheme, BaseLightColorScheme, BlendBiColorScheme, ColorBlindColorScheme, HueShiftColorScheme, InvertedColorScheme, MixColorScheme, NegatedColorScheme, SaturatedColorScheme, ShiftColorScheme

public abstract class BaseColorScheme extends Object implements RadianceColorScheme
Base class for Radiance color schemes.
  • Field Details

    • isDark

      protected boolean isDark
      Indicates whether this color scheme is dark.
    • displayName

      protected String displayName
      Display name of this color scheme.
    • derivedColorsResolver

      private SchemeDerivedColors derivedColorsResolver
      Resolver for the derived colors.
  • Constructor Details

    • BaseColorScheme

      protected BaseColorScheme(String displayName, boolean isDark)
      Constructs the basic functionality of a color scheme.
      Parameters:
      displayName - Display name.
      isDark - Indication whether the color scheme is dark.
  • Method Details

    • getDisplayName

      public final String getDisplayName()
      Description copied from interface: RadianceTrait
      Returns the display name of this trait. This method is part of officially supported API.
      Specified by:
      getDisplayName in interface RadianceTrait
      Returns:
      The display name of this trait.
    • isDark

      public final boolean isDark()
      Description copied from interface: RadianceColorScheme
      Returns indication whether this color scheme uses dark colors. Note that this method may be removed in the future. It is highly recommended to use one of the colors from the parent SchemeBaseColors and SchemeDerivedColors interfaces instead.
      Specified by:
      isDark in interface RadianceColorScheme
      Returns:
      true if this color scheme uses dark colors, false otherwise.
    • shift

      public final RadianceColorScheme shift(Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor)
      Description copied from interface: RadianceColorScheme
      Creates a shift version of this scheme.
      Specified by:
      shift in interface RadianceColorScheme
      Parameters:
      backgroundShiftColor - Shift color for background colors. Should have full opacity.
      backgroundShiftFactor - Value in 0.0...1.0 range. Larger values shift more towards the specified color.
      foregroundShiftColor - Shift color for foreground colors. Should have full opacity.
      foregroundShiftFactor - Value in 0.0...1.0 range. Larger values shift more towards the specified color.
      Returns:
      Shift version of this scheme.
    • shiftBackground

      public final RadianceColorScheme shiftBackground(Color backgroundShiftColor, double backgroundShiftFactor)
      Description copied from interface: RadianceColorScheme
      Creates a shift version of this scheme.
      Specified by:
      shiftBackground in interface RadianceColorScheme
      Parameters:
      backgroundShiftColor - Shift color for background colors. Should have full opacity.
      backgroundShiftFactor - Value in 0.0...1.0 range. Larger values shift more towards the specified color.
      Returns:
      Shift version of this scheme that does not change the foreground color.
    • tint

      public RadianceColorScheme tint(double tintFactor)
      Description copied from interface: RadianceColorScheme
      Creates a tinted (shifted towards white) version of this color scheme.
      Specified by:
      tint in interface RadianceColorScheme
      Parameters:
      tintFactor - Value in 0.0...1.0 range. Larger values shift more towards white color.
      Returns:
      Tinted version of this scheme.
    • tone

      public RadianceColorScheme tone(double toneFactor)
      Description copied from interface: RadianceColorScheme
      Creates a toned (shifted towards gray) version of this color scheme.
      Specified by:
      tone in interface RadianceColorScheme
      Parameters:
      toneFactor - Value in 0.0...1.0 range. Larger values shift more towards gray color.
      Returns:
      Toned version of this scheme.
    • shade

      public RadianceColorScheme shade(double shadeFactor)
      Description copied from interface: RadianceColorScheme
      Creates a shaded (shifted towards black) version of this color scheme.
      Specified by:
      shade in interface RadianceColorScheme
      Parameters:
      shadeFactor - Value in 0.0...1.0 range. Larger values shift more towards black color.
      Returns:
      Shaded version of this scheme.
    • saturate

      public RadianceColorScheme saturate(double saturateFactor)
      Description copied from interface: RadianceColorScheme
      Creates a saturated or desaturated version of this scheme. The value and brightness stay the same.
      Specified by:
      saturate in interface RadianceColorScheme
      Parameters:
      saturateFactor - Value in -1.0...1.0 range. Positive values create more saturated colors. Negative values create more desaturated colors.
      Returns:
      Saturated version of this scheme.
    • invert

      public RadianceColorScheme invert()
      Description copied from interface: RadianceColorScheme
      Creates an inverted version of this scheme.
      Specified by:
      invert in interface RadianceColorScheme
      Returns:
      Inverted version of this scheme.
    • negate

      public RadianceColorScheme negate()
      Description copied from interface: RadianceColorScheme
      Creates a negated version of this scheme.
      Specified by:
      negate in interface RadianceColorScheme
      Returns:
      Negated version of this scheme.
    • hueShift

      public RadianceColorScheme hueShift(double hueShiftFactor)
      Description copied from interface: RadianceColorScheme
      Creates a hue-shifted (in HSB space) version of this color scheme.
      Specified by:
      hueShift in interface RadianceColorScheme
      Parameters:
      hueShiftFactor - Value in -1.0...1.0 range.
      Returns:
      Hue-shifted version of this scheme.
    • blendWith

      public RadianceColorScheme blendWith(RadianceColorScheme otherScheme, double likenessToThisScheme)
      Description copied from interface: RadianceColorScheme
      Creates a blended version of this color scheme based on another color scheme.
      Specified by:
      blendWith in interface RadianceColorScheme
      Parameters:
      otherScheme - The other color scheme for blending colors.
      likenessToThisScheme - Defines how close the colors of the resulting color scheme are to this scheme. Value of 1.0 returns a color scheme with the exact colors of this color scheme. Value of 0.0 returns a color scheme with the exact colors of the other color scheme.
      Returns:
      Blended color scheme.
    • getBackgroundFillColor

      public Color getBackgroundFillColor()
      Description copied from interface: SchemeDerivedColors
      Returns the background fill color for this scheme.
      Specified by:
      getBackgroundFillColor in interface SchemeDerivedColors
      Returns:
      The background fill color for this scheme.
    • getAccentedBackgroundFillColor

      public Color getAccentedBackgroundFillColor()
      Description copied from interface: SchemeDerivedColors
      Returns the accented background fill color for this scheme.
      Specified by:
      getAccentedBackgroundFillColor in interface SchemeDerivedColors
      Returns:
      The accented background fill color for this scheme.
    • getFocusRingColor

      public Color getFocusRingColor()
      Description copied from interface: SchemeDerivedColors
      Returns the focus ring color for this scheme.
      Specified by:
      getFocusRingColor in interface SchemeDerivedColors
      Returns:
      The focus ring color for this scheme.
      See Also:
    • getLineColor

      public Color getLineColor()
      Description copied from interface: SchemeDerivedColors
      Returns the line color for this scheme.
      Specified by:
      getLineColor in interface SchemeDerivedColors
      Returns:
      The line color for this scheme.
      See Also:
    • getSelectionForegroundColor

      public Color getSelectionForegroundColor()
      Description copied from interface: SchemeDerivedColors
      Returns the selection foreground color for this scheme.
      Specified by:
      getSelectionForegroundColor in interface SchemeDerivedColors
      Returns:
      The selection foreground color for this scheme.
    • getSelectionBackgroundColor

      public Color getSelectionBackgroundColor()
      Description copied from interface: SchemeDerivedColors
      Returns the selection background color for this scheme.
      Specified by:
      getSelectionBackgroundColor in interface SchemeDerivedColors
      Returns:
      The selection background color for this scheme.
    • getTextBackgroundFillColor

      public Color getTextBackgroundFillColor()
      Description copied from interface: SchemeDerivedColors
      Returns the text background fill color for this scheme.
      Specified by:
      getTextBackgroundFillColor in interface SchemeDerivedColors
      Returns:
      The text background fill color for this scheme.
    • getSeparatorPrimaryColor

      public Color getSeparatorPrimaryColor()
      Description copied from interface: SchemeDerivedColors
      Returns the primary separator color for this scheme.
      Specified by:
      getSeparatorPrimaryColor in interface SchemeDerivedColors
      Returns:
      The primary separator color for this scheme.
    • getSeparatorSecondaryColor

      public Color getSeparatorSecondaryColor()
      Description copied from interface: SchemeDerivedColors
      Returns the secondary separator color for this scheme.
      Specified by:
      getSeparatorSecondaryColor in interface SchemeDerivedColors
      Returns:
      The secondary separator color for this scheme.
    • getMarkColor

      public Color getMarkColor()
      Description copied from interface: SchemeDerivedColors
      Returns the mark color for this scheme. Mark color is used on checkboxes, radio buttons, scrollbar arrows, combo arrows, menu arrows, etc.
      Specified by:
      getMarkColor in interface SchemeDerivedColors
      Returns:
      The mark color for this scheme.
    • getEchoColor

      public Color getEchoColor()
      Description copied from interface: SchemeDerivedColors
      Returns the echo color for this scheme. Echo color is used for drawing slight echo / drop shadow around title pane texts and similar "primary" elements.
      Specified by:
      getEchoColor in interface SchemeDerivedColors
      Returns:
      The echo color for this scheme.
    • named

      public final RadianceColorScheme named(String colorSchemeDisplayName)
      Description copied from interface: RadianceColorScheme
      This method is a fluent-interface builder utility for setting the display name for this color scheme. The implementation must return the same this instance.
      Specified by:
      named in interface RadianceColorScheme
      Parameters:
      colorSchemeDisplayName - New display name for this color scheme.
      Returns:
      This color scheme.
    • toString

      public String toString()
      Overrides:
      toString in class Object