Class BaseColorScheme
java.lang.Object
org.pushingpixels.substance.api.colorscheme.BaseColorScheme
- All Implemented Interfaces:
SchemeBaseColors
,SchemeDerivedColors
,SubstanceColorScheme
,SubstanceTrait
- Direct Known Subclasses:
BaseDarkColorScheme
,BaseLightColorScheme
,BlendBiColorScheme
,HueShiftColorScheme
,InvertedColorScheme
,NegatedColorScheme
,SaturatedColorScheme
,ShiftColorScheme
Base class for Substance color schemes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SchemeDerivedColorsResolver
Resolver for the derived colors.protected String
Display name of this color scheme.protected boolean
Indicates whether this color scheme is dark. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseColorScheme
(String displayName, boolean isDark) Constructs the basic functionality of a color scheme.protected
BaseColorScheme
(String displayName, SchemeDerivedColorsResolver derivedColorsResolver) Constructs the basic functionality of a color scheme. -
Method Summary
Modifier and TypeMethodDescriptionfinal Color
Returns the background fill color forthis
scheme.final String
Returns the display name ofthis
trait.final Color
Returns the focus ring color forthis
scheme.final Color
Returns the line color forthis
scheme.protected static SchemeDerivedColorsResolver
getResolver
(SubstanceColorScheme colorScheme) Allows subclasses to determine the best color resolver.final Color
Returns the selection background color forthis
scheme.final Color
Returns the selection foreground color forthis
scheme.final Color
Returns the text background fill color forthis
scheme.final Color
Returns the watermark dark color forthis
scheme.final Color
Returns the watermark light color forthis
scheme.final Color
Returns the watermark stamp color forthis
scheme.hueShift
(double hueShiftFactor) Creates a hue-shifted (in HSB space) version ofthis
color scheme.invert()
Creates an inverted version ofthis
scheme.final boolean
isDark()
Returns indication whether this color scheme uses dark colors.final SubstanceColorScheme
This method is a fluent-interface builder utility for setting the display name for this color scheme.negate()
Creates a negated version ofthis
scheme.saturate
(double saturateFactor) Creates a saturated or desaturated version ofthis
scheme.shade
(double shadeFactor) Creates a shaded (shifted towards black) version ofthis
color scheme.final SubstanceColorScheme
shift
(Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Creates a shift version ofthis
scheme.final SubstanceColorScheme
shiftBackground
(Color backgroundShiftColor, double backgroundShiftFactor) Creates a shift version ofthis
scheme.tint
(double tintFactor) Creates a tinted (shifted towards white) version ofthis
color scheme.tone
(double toneFactor) Creates a toned (shifted towards gray) version ofthis
color scheme.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.pushingpixels.substance.api.SchemeBaseColors
getDarkColor, getExtraLightColor, getForegroundColor, getLightColor, getMidColor, getUltraDarkColor, getUltraLightColor
-
Field Details
-
isDark
protected boolean isDarkIndicates whether this color scheme is dark. -
displayName
Display name of this color scheme. -
derivedColorsResolver
Resolver for the derived colors.
-
-
Constructor Details
-
BaseColorScheme
Constructs the basic functionality of a color scheme.- Parameters:
displayName
- Display name.isDark
- Indication whether the color scheme is dark.
-
BaseColorScheme
Constructs the basic functionality of a color scheme.Subclasses should typically invoke this constructor.
- Parameters:
displayName
- Display name.derivedColorsResolver
- A resolver that determine how derived colors are derived- Throws:
NullPointerException
- ifderivedColorsResolver
isnull
-
-
Method Details
-
getResolver
Allows subclasses to determine the best color resolver. This is typically used by color scheme that wrap other color scheme, such as color shifting or color inversion.- Parameters:
colorScheme
- the color scheme to test- Returns:
- a resolver for the supplied color scheme
-
getDisplayName
Description copied from interface:SubstanceTrait
Returns the display name ofthis
trait. This method is part of officially supported API.- Specified by:
getDisplayName
in interfaceSubstanceTrait
- Returns:
- The display name of
this
trait.
-
isDark
public final boolean isDark()Description copied from interface:SubstanceColorScheme
Returns indication whether this color scheme uses dark colors. Note that this method may be removed in the future.- Specified by:
isDark
in interfaceSubstanceColorScheme
- Returns:
true
if this color scheme uses dark colors,false
otherwise.
-
shift
public final SubstanceColorScheme shift(Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Description copied from interface:SubstanceColorScheme
Creates a shift version ofthis
scheme.- Specified by:
shift
in interfaceSubstanceColorScheme
- 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 SubstanceColorScheme shiftBackground(Color backgroundShiftColor, double backgroundShiftFactor) Description copied from interface:SubstanceColorScheme
Creates a shift version ofthis
scheme.- Specified by:
shiftBackground
in interfaceSubstanceColorScheme
- 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
Description copied from interface:SubstanceColorScheme
Creates a tinted (shifted towards white) version ofthis
color scheme.- Specified by:
tint
in interfaceSubstanceColorScheme
- Parameters:
tintFactor
- Value in 0.0...1.0 range. Larger values shift more towards white color.- Returns:
- Tinted version of
this
scheme.
-
tone
Description copied from interface:SubstanceColorScheme
Creates a toned (shifted towards gray) version ofthis
color scheme.- Specified by:
tone
in interfaceSubstanceColorScheme
- Parameters:
toneFactor
- Value in 0.0...1.0 range. Larger values shift more towards gray color.- Returns:
- Toned version of
this
scheme.
-
shade
Description copied from interface:SubstanceColorScheme
Creates a shaded (shifted towards black) version ofthis
color scheme.- Specified by:
shade
in interfaceSubstanceColorScheme
- Parameters:
shadeFactor
- Value in 0.0...1.0 range. Larger values shift more towards black color.- Returns:
- Shaded version of
this
scheme.
-
saturate
Description copied from interface:SubstanceColorScheme
Creates a saturated or desaturated version ofthis
scheme. The value and brightness stay the same.- Specified by:
saturate
in interfaceSubstanceColorScheme
- 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
Description copied from interface:SubstanceColorScheme
Creates an inverted version ofthis
scheme.- Specified by:
invert
in interfaceSubstanceColorScheme
- Returns:
- Inverted version of
this
scheme.
-
negate
Description copied from interface:SubstanceColorScheme
Creates a negated version ofthis
scheme.- Specified by:
negate
in interfaceSubstanceColorScheme
- Returns:
- Negated version of
this
scheme.
-
hueShift
Description copied from interface:SubstanceColorScheme
Creates a hue-shifted (in HSB space) version ofthis
color scheme.- Specified by:
hueShift
in interfaceSubstanceColorScheme
- Parameters:
hueShiftFactor
- Value in -1.0...1.0 range.- Returns:
- Hue-shifted version of
this
scheme.
-
getBackgroundFillColor
Description copied from interface:SchemeDerivedColors
Returns the background fill color forthis
scheme.- Specified by:
getBackgroundFillColor
in interfaceSchemeDerivedColors
- Returns:
- The background fill color for
this
scheme.
-
getFocusRingColor
Description copied from interface:SchemeDerivedColors
Returns the focus ring color forthis
scheme.- Specified by:
getFocusRingColor
in interfaceSchemeDerivedColors
- Returns:
- The focus ring color for
this
scheme.
-
getLineColor
Description copied from interface:SchemeDerivedColors
Returns the line color forthis
scheme.- Specified by:
getLineColor
in interfaceSchemeDerivedColors
- Returns:
- The line color for
this
scheme.
-
getSelectionForegroundColor
Description copied from interface:SchemeDerivedColors
Returns the selection foreground color forthis
scheme.- Specified by:
getSelectionForegroundColor
in interfaceSchemeDerivedColors
- Returns:
- The selection foreground color for
this
scheme.
-
getSelectionBackgroundColor
Description copied from interface:SchemeDerivedColors
Returns the selection background color forthis
scheme.- Specified by:
getSelectionBackgroundColor
in interfaceSchemeDerivedColors
- Returns:
- The selection background color for
this
scheme.
-
getWatermarkDarkColor
Description copied from interface:SchemeDerivedColors
Returns the watermark dark color forthis
scheme.- Specified by:
getWatermarkDarkColor
in interfaceSchemeDerivedColors
- Returns:
- Watermark dark color for
this
scheme.
-
getWatermarkLightColor
Description copied from interface:SchemeDerivedColors
Returns the watermark light color forthis
scheme.- Specified by:
getWatermarkLightColor
in interfaceSchemeDerivedColors
- Returns:
- Watermark light color for
this
scheme.
-
getWatermarkStampColor
Description copied from interface:SchemeDerivedColors
Returns the watermark stamp color forthis
scheme.- Specified by:
getWatermarkStampColor
in interfaceSchemeDerivedColors
- Returns:
- Watermark stamp color for
this
scheme.
-
getTextBackgroundFillColor
Description copied from interface:SchemeDerivedColors
Returns the text background fill color forthis
scheme.- Specified by:
getTextBackgroundFillColor
in interfaceSchemeDerivedColors
- Returns:
- The text background fill color for
this
scheme.
-
named
Description copied from interface:SubstanceColorScheme
This method is a fluent-interface builder utility for setting the display name for this color scheme. The implementation must return the samethis
instance.- Specified by:
named
in interfaceSubstanceColorScheme
- Parameters:
colorSchemeDisplayName
- New display name for this color scheme.- Returns:
- This color scheme.
-
toString
-