Class ShiftColorScheme
- java.lang.Object
-
- org.pushingpixels.substance.api.colorscheme.BaseColorScheme
-
- org.pushingpixels.substance.internal.colorscheme.ShiftColorScheme
-
- All Implemented Interfaces:
SchemeBaseColors,SchemeDerivedColors,SubstanceColorScheme,SubstanceTrait
- Direct Known Subclasses:
ShadeColorScheme,TintColorScheme,ToneColorScheme
public class ShiftColorScheme extends BaseColorScheme
Base class for shifted color schemes. A shifted color scheme is based on some original color scheme, a shift color and a shift factor. All colors of the original color scheme are shifted towards the shift color based on the shift factor. The closer the shift factor value is to 1.0, the closer the colors of the shifted color scheme will be to the shift color.
-
-
Field Summary
Fields Modifier and Type Field Description protected static LazyResettableHashMap<SubstanceColorScheme>shiftedCacheCache of shifted schemes.-
Fields inherited from class org.pushingpixels.substance.api.colorscheme.BaseColorScheme
derivedColorsResolver, displayName, isDark
-
-
Constructor Summary
Constructors Constructor Description ShiftColorScheme(SubstanceColorScheme origScheme, Color shiftColor, double shiftFactor)Creates a new shifted color scheme.ShiftColorScheme(SubstanceColorScheme origScheme, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor, boolean shiftByBrightness)Creates a new shifted color scheme.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetDarkColor()Retrieves the dark color.ColorgetExtraLightColor()Retrieves the extra color.ColorgetForegroundColor()Retrieves the foreground color.ColorgetLightColor()Retrieves the light color.ColorgetMidColor()Retrieves the medium color.SubstanceColorSchemegetOrigScheme()Returns the original color scheme.static SubstanceColorSchemegetShiftedScheme(SubstanceColorScheme orig, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor)Returns a shifted color scheme.doublegetShiftFactor()Returns the shift factor.ColorgetUltraDarkColor()Retrieves the ultra-dark color.ColorgetUltraLightColor()Retrieves the ultra-light color.-
Methods inherited from class org.pushingpixels.substance.api.colorscheme.BaseColorScheme
getBackgroundFillColor, getDisplayName, getFocusRingColor, getLineColor, getResolver, getSelectionBackgroundColor, getSelectionForegroundColor, getTextBackgroundFillColor, getWatermarkDarkColor, getWatermarkLightColor, getWatermarkStampColor, hueShift, invert, isDark, named, negate, saturate, shade, shift, shiftBackground, tint, tone, toString
-
-
-
-
Field Detail
-
shiftedCache
protected static final LazyResettableHashMap<SubstanceColorScheme> shiftedCache
Cache of shifted schemes.
-
-
Constructor Detail
-
ShiftColorScheme
public ShiftColorScheme(SubstanceColorScheme origScheme, Color shiftColor, double shiftFactor)
Creates a new shifted color scheme.- Parameters:
origScheme- The original color scheme.shiftColor- Shift color for the colors.shiftFactor- Shift factor for the colors. Should be in 0.0-1.0 range.
-
ShiftColorScheme
public ShiftColorScheme(SubstanceColorScheme origScheme, Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor, boolean shiftByBrightness)
Creates a new shifted color scheme.- Parameters:
origScheme- The original color scheme.backgroundShiftColor- Shift color for the background colors.backgroundShiftFactor- Shift factor for the background colors. Should be in 0.0-1.0 range.foregroundShiftColor- Shift color for the foreground colors.foregroundShiftFactor- Shift factor for the foreground colors. Should be in 0.0-1.0 range.shiftByBrightness- Iftrue, the shift will account for the brightness of the original color scheme colors.
-
-
Method Detail
-
getForegroundColor
public Color getForegroundColor()
Description copied from interface:SchemeBaseColorsRetrieves the foreground color.- Returns:
- Foreground color.
-
getUltraLightColor
public Color getUltraLightColor()
Description copied from interface:SchemeBaseColorsRetrieves the ultra-light color.- Returns:
- Ultra-light color.
-
getExtraLightColor
public Color getExtraLightColor()
Description copied from interface:SchemeBaseColorsRetrieves the extra color.- Returns:
- Extra color.
-
getLightColor
public Color getLightColor()
Description copied from interface:SchemeBaseColorsRetrieves the light color.- Returns:
- Light color.
-
getMidColor
public Color getMidColor()
Description copied from interface:SchemeBaseColorsRetrieves the medium color.- Returns:
- Medium color.
-
getDarkColor
public Color getDarkColor()
Description copied from interface:SchemeBaseColorsRetrieves the dark color.- Returns:
- Dark color.
-
getUltraDarkColor
public Color getUltraDarkColor()
Description copied from interface:SchemeBaseColorsRetrieves the ultra-dark color.- Returns:
- Ultra-dark color.
-
getOrigScheme
public SubstanceColorScheme getOrigScheme()
Returns the original color scheme.- Returns:
- The original color scheme.
-
getShiftFactor
public double getShiftFactor()
Returns the shift factor.- Returns:
- Shift factor.
-
getShiftedScheme
public static SubstanceColorScheme getShiftedScheme(SubstanceColorScheme 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.
-
-