Class BaseColorScheme
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.colorscheme.BaseColorScheme
-
- All Implemented Interfaces:
RadianceColorScheme,SchemeBaseColors,SchemeDerivedColors,RadianceTrait
- Direct Known Subclasses:
BaseDarkColorScheme,BaseLightColorScheme
public abstract class BaseColorScheme extends java.lang.Object implements RadianceColorScheme
Base class for Radiance color schemes.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdisplayNameDisplay name of this color scheme.protected booleanisDarkIndicates whether this color scheme is dark.
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseColorScheme(java.lang.String displayName, boolean isDark)Constructs the basic functionality of a color scheme.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RadianceColorSchemeblendWith(RadianceColorScheme otherScheme, double likenessToThisScheme)Creates a blended version ofthiscolor scheme based on another color scheme.java.awt.ColorgetAccentedBackgroundFillColor()Returns the accented background fill color forthisscheme.java.awt.ColorgetBackgroundFillColor()Returns the background fill color forthisscheme.java.lang.StringgetDisplayName()Returns the display name ofthistrait.java.awt.ColorgetEchoColor()Returns the echo color forthisscheme.java.awt.ColorgetFocusRingColor()Returns the focus ring color forthisscheme.java.awt.ColorgetLineColor()Returns the line color forthisscheme.java.awt.ColorgetMarkColor()Returns the mark color forthisscheme.java.awt.ColorgetSelectionBackgroundColor()Returns the selection background color forthisscheme.java.awt.ColorgetSelectionForegroundColor()Returns the selection foreground color forthisscheme.java.awt.ColorgetSeparatorPrimaryColor()Returns the primary separator color forthisscheme.java.awt.ColorgetSeparatorSecondaryColor()Returns the secondary separator color forthisscheme.java.awt.ColorgetTextBackgroundFillColor()Returns the text background fill color forthisscheme.RadianceColorSchemehueShift(double hueShiftFactor)Creates a hue-shifted (in HSB space) version ofthiscolor scheme.RadianceColorSchemeinvert()Creates an inverted version ofthisscheme.booleanisDark()Returns indication whether this color scheme uses dark colors.RadianceColorSchemenamed(java.lang.String colorSchemeDisplayName)This method is a fluent-interface builder utility for setting the display name for this color scheme.RadianceColorSchemenegate()Creates a negated version ofthisscheme.RadianceColorSchemesaturate(double saturateFactor)Creates a saturated or desaturated version ofthisscheme.RadianceColorSchemeshade(double shadeFactor)Creates a shaded (shifted towards black) version ofthiscolor scheme.RadianceColorSchemeshift(java.awt.Color backgroundShiftColor, double backgroundShiftFactor, java.awt.Color foregroundShiftColor, double foregroundShiftFactor)Creates a shift version ofthisscheme.RadianceColorSchemeshiftBackground(java.awt.Color backgroundShiftColor, double backgroundShiftFactor)Creates a shift version ofthisscheme.RadianceColorSchemetint(double tintFactor)Creates a tinted (shifted towards white) version ofthiscolor scheme.RadianceColorSchemetone(double toneFactor)Creates a toned (shifted towards gray) version ofthiscolor scheme.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme
getColorFilter
-
Methods inherited from interface org.pushingpixels.radiance.theming.api.colorscheme.SchemeBaseColors
getDarkColor, getExtraLightColor, getForegroundColor, getLightColor, getMidColor, getUltraDarkColor, getUltraLightColor, toImage
-
-
-
-
Method Detail
-
getDisplayName
public final java.lang.String getDisplayName()
Description copied from interface:RadianceTraitReturns the display name ofthistrait. This method is part of officially supported API.- Specified by:
getDisplayNamein interfaceRadianceTrait- Returns:
- The display name of
thistrait.
-
isDark
public final boolean isDark()
Description copied from interface:RadianceColorSchemeReturns 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 parentSchemeBaseColorsandSchemeDerivedColorsinterfaces instead.- Specified by:
isDarkin interfaceRadianceColorScheme- Returns:
trueif this color scheme uses dark colors,falseotherwise.
-
shift
public final RadianceColorScheme shift(java.awt.Color backgroundShiftColor, double backgroundShiftFactor, java.awt.Color foregroundShiftColor, double foregroundShiftFactor)
Description copied from interface:RadianceColorSchemeCreates a shift version ofthisscheme.- Specified by:
shiftin interfaceRadianceColorScheme- 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
thisscheme.
-
shiftBackground
public final RadianceColorScheme shiftBackground(java.awt.Color backgroundShiftColor, double backgroundShiftFactor)
Description copied from interface:RadianceColorSchemeCreates a shift version ofthisscheme.- Specified by:
shiftBackgroundin interfaceRadianceColorScheme- 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
thisscheme that does not change the foreground color.
-
tint
public RadianceColorScheme tint(double tintFactor)
Description copied from interface:RadianceColorSchemeCreates a tinted (shifted towards white) version ofthiscolor scheme.- Specified by:
tintin interfaceRadianceColorScheme- Parameters:
tintFactor- Value in 0.0...1.0 range. Larger values shift more towards white color.- Returns:
- Tinted version of
thisscheme.
-
tone
public RadianceColorScheme tone(double toneFactor)
Description copied from interface:RadianceColorSchemeCreates a toned (shifted towards gray) version ofthiscolor scheme.- Specified by:
tonein interfaceRadianceColorScheme- Parameters:
toneFactor- Value in 0.0...1.0 range. Larger values shift more towards gray color.- Returns:
- Toned version of
thisscheme.
-
shade
public RadianceColorScheme shade(double shadeFactor)
Description copied from interface:RadianceColorSchemeCreates a shaded (shifted towards black) version ofthiscolor scheme.- Specified by:
shadein interfaceRadianceColorScheme- Parameters:
shadeFactor- Value in 0.0...1.0 range. Larger values shift more towards black color.- Returns:
- Shaded version of
thisscheme.
-
saturate
public RadianceColorScheme saturate(double saturateFactor)
Description copied from interface:RadianceColorSchemeCreates a saturated or desaturated version ofthisscheme. The value and brightness stay the same.- Specified by:
saturatein interfaceRadianceColorScheme- 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
thisscheme.
-
invert
public RadianceColorScheme invert()
Description copied from interface:RadianceColorSchemeCreates an inverted version ofthisscheme.- Specified by:
invertin interfaceRadianceColorScheme- Returns:
- Inverted version of
thisscheme.
-
negate
public RadianceColorScheme negate()
Description copied from interface:RadianceColorSchemeCreates a negated version ofthisscheme.- Specified by:
negatein interfaceRadianceColorScheme- Returns:
- Negated version of
thisscheme.
-
hueShift
public RadianceColorScheme hueShift(double hueShiftFactor)
Description copied from interface:RadianceColorSchemeCreates a hue-shifted (in HSB space) version ofthiscolor scheme.- Specified by:
hueShiftin interfaceRadianceColorScheme- Parameters:
hueShiftFactor- Value in -1.0...1.0 range.- Returns:
- Hue-shifted version of
thisscheme.
-
blendWith
public RadianceColorScheme blendWith(RadianceColorScheme otherScheme, double likenessToThisScheme)
Description copied from interface:RadianceColorSchemeCreates a blended version ofthiscolor scheme based on another color scheme.- Specified by:
blendWithin interfaceRadianceColorScheme- 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 java.awt.Color getBackgroundFillColor()
Description copied from interface:SchemeDerivedColorsReturns the background fill color forthisscheme.- Specified by:
getBackgroundFillColorin interfaceSchemeDerivedColors- Returns:
- The background fill color for
thisscheme.
-
getAccentedBackgroundFillColor
public java.awt.Color getAccentedBackgroundFillColor()
Description copied from interface:SchemeDerivedColorsReturns the accented background fill color forthisscheme.- Specified by:
getAccentedBackgroundFillColorin interfaceSchemeDerivedColors- Returns:
- The accented background fill color for
thisscheme.
-
getFocusRingColor
public java.awt.Color getFocusRingColor()
Description copied from interface:SchemeDerivedColorsReturns the focus ring color forthisscheme.- Specified by:
getFocusRingColorin interfaceSchemeDerivedColors- Returns:
- The focus ring color for
thisscheme. - See Also:
RadianceSkin.getOverlayColor(RadianceThemingSlices.ColorOverlayType, RadianceThemingSlices.DecorationAreaType, ComponentState)
-
getLineColor
public java.awt.Color getLineColor()
Description copied from interface:SchemeDerivedColorsReturns the line color forthisscheme.- Specified by:
getLineColorin interfaceSchemeDerivedColors- Returns:
- The line color for
thisscheme. - See Also:
RadianceSkin.getOverlayColor(RadianceThemingSlices.ColorOverlayType, RadianceThemingSlices.DecorationAreaType, ComponentState)
-
getSelectionForegroundColor
public java.awt.Color getSelectionForegroundColor()
Description copied from interface:SchemeDerivedColorsReturns the selection foreground color forthisscheme.- Specified by:
getSelectionForegroundColorin interfaceSchemeDerivedColors- Returns:
- The selection foreground color for
thisscheme.
-
getSelectionBackgroundColor
public java.awt.Color getSelectionBackgroundColor()
Description copied from interface:SchemeDerivedColorsReturns the selection background color forthisscheme.- Specified by:
getSelectionBackgroundColorin interfaceSchemeDerivedColors- Returns:
- The selection background color for
thisscheme.
-
getTextBackgroundFillColor
public java.awt.Color getTextBackgroundFillColor()
Description copied from interface:SchemeDerivedColorsReturns the text background fill color forthisscheme.- Specified by:
getTextBackgroundFillColorin interfaceSchemeDerivedColors- Returns:
- The text background fill color for
thisscheme.
-
getSeparatorPrimaryColor
public java.awt.Color getSeparatorPrimaryColor()
Description copied from interface:SchemeDerivedColorsReturns the primary separator color forthisscheme.- Specified by:
getSeparatorPrimaryColorin interfaceSchemeDerivedColors- Returns:
- The primary separator color for
thisscheme.
-
getSeparatorSecondaryColor
public java.awt.Color getSeparatorSecondaryColor()
Description copied from interface:SchemeDerivedColorsReturns the secondary separator color forthisscheme.- Specified by:
getSeparatorSecondaryColorin interfaceSchemeDerivedColors- Returns:
- The secondary separator color for
thisscheme.
-
getMarkColor
public java.awt.Color getMarkColor()
Description copied from interface:SchemeDerivedColorsReturns the mark color forthisscheme. Mark color is used on checkboxes, radio buttons, scrollbar arrows, combo arrows, menu arrows, etc.- Specified by:
getMarkColorin interfaceSchemeDerivedColors- Returns:
- The mark color for
thisscheme.
-
getEchoColor
public java.awt.Color getEchoColor()
Description copied from interface:SchemeDerivedColorsReturns the echo color forthisscheme. Echo color is used for drawing slight echo / drop shadow around title pane texts and similar "primary" elements.- Specified by:
getEchoColorin interfaceSchemeDerivedColors- Returns:
- The echo color for
thisscheme.
-
named
public final RadianceColorScheme named(java.lang.String colorSchemeDisplayName)
Description copied from interface:RadianceColorSchemeThis method is a fluent-interface builder utility for setting the display name for this color scheme. The implementation must return the samethisinstance.- Specified by:
namedin interfaceRadianceColorScheme- Parameters:
colorSchemeDisplayName- New display name for this color scheme.- Returns:
- This color scheme.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-