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 SchemeDerivedColorsResolverResolver for the derived colors.protected StringDisplay name of this color scheme.protected booleanIndicates whether this color scheme is dark. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseColorScheme(String displayName, boolean isDark) Constructs the basic functionality of a color scheme.protectedBaseColorScheme(String displayName, SchemeDerivedColorsResolver derivedColorsResolver) Constructs the basic functionality of a color scheme. -
Method Summary
Modifier and TypeMethodDescriptionfinal ColorReturns the background fill color forthisscheme.final StringReturns the display name ofthistrait.final ColorReturns the focus ring color forthisscheme.final ColorReturns the line color forthisscheme.protected static SchemeDerivedColorsResolvergetResolver(SubstanceColorScheme colorScheme) Allows subclasses to determine the best color resolver.final ColorReturns the selection background color forthisscheme.final ColorReturns the selection foreground color forthisscheme.final ColorReturns the text background fill color forthisscheme.final ColorReturns the watermark dark color forthisscheme.final ColorReturns the watermark light color forthisscheme.final ColorReturns the watermark stamp color forthisscheme.hueShift(double hueShiftFactor) Creates a hue-shifted (in HSB space) version ofthiscolor scheme.invert()Creates an inverted version ofthisscheme.final booleanisDark()Returns indication whether this color scheme uses dark colors.final SubstanceColorSchemeThis method is a fluent-interface builder utility for setting the display name for this color scheme.negate()Creates a negated version ofthisscheme.saturate(double saturateFactor) Creates a saturated or desaturated version ofthisscheme.shade(double shadeFactor) Creates a shaded (shifted towards black) version ofthiscolor scheme.final SubstanceColorSchemeshift(Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Creates a shift version ofthisscheme.final SubstanceColorSchemeshiftBackground(Color backgroundShiftColor, double backgroundShiftFactor) Creates a shift version ofthisscheme.tint(double tintFactor) Creates a tinted (shifted towards white) version ofthiscolor scheme.tone(double toneFactor) Creates a toned (shifted towards gray) version ofthiscolor scheme.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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- ifderivedColorsResolverisnull
-
-
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:SubstanceTraitReturns the display name ofthistrait. This method is part of officially supported API.- Specified by:
getDisplayNamein interfaceSubstanceTrait- Returns:
- The display name of
thistrait.
-
isDark
public final boolean isDark()Description copied from interface:SubstanceColorSchemeReturns indication whether this color scheme uses dark colors. Note that this method may be removed in the future.- Specified by:
isDarkin interfaceSubstanceColorScheme- Returns:
trueif this color scheme uses dark colors,falseotherwise.
-
shift
public final SubstanceColorScheme shift(Color backgroundShiftColor, double backgroundShiftFactor, Color foregroundShiftColor, double foregroundShiftFactor) Description copied from interface:SubstanceColorSchemeCreates a shift version ofthisscheme.- Specified by:
shiftin 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
thisscheme.
-
shiftBackground
public final SubstanceColorScheme shiftBackground(Color backgroundShiftColor, double backgroundShiftFactor) Description copied from interface:SubstanceColorSchemeCreates a shift version ofthisscheme.- Specified by:
shiftBackgroundin 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
thisscheme that does not change the foreground color.
-
tint
Description copied from interface:SubstanceColorSchemeCreates a tinted (shifted towards white) version ofthiscolor scheme.- Specified by:
tintin interfaceSubstanceColorScheme- Parameters:
tintFactor- Value in 0.0...1.0 range. Larger values shift more towards white color.- Returns:
- Tinted version of
thisscheme.
-
tone
Description copied from interface:SubstanceColorSchemeCreates a toned (shifted towards gray) version ofthiscolor scheme.- Specified by:
tonein interfaceSubstanceColorScheme- Parameters:
toneFactor- Value in 0.0...1.0 range. Larger values shift more towards gray color.- Returns:
- Toned version of
thisscheme.
-
shade
Description copied from interface:SubstanceColorSchemeCreates a shaded (shifted towards black) version ofthiscolor scheme.- Specified by:
shadein interfaceSubstanceColorScheme- Parameters:
shadeFactor- Value in 0.0...1.0 range. Larger values shift more towards black color.- Returns:
- Shaded version of
thisscheme.
-
saturate
Description copied from interface:SubstanceColorSchemeCreates a saturated or desaturated version ofthisscheme. The value and brightness stay the same.- Specified by:
saturatein 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
thisscheme.
-
invert
Description copied from interface:SubstanceColorSchemeCreates an inverted version ofthisscheme.- Specified by:
invertin interfaceSubstanceColorScheme- Returns:
- Inverted version of
thisscheme.
-
negate
Description copied from interface:SubstanceColorSchemeCreates a negated version ofthisscheme.- Specified by:
negatein interfaceSubstanceColorScheme- Returns:
- Negated version of
thisscheme.
-
hueShift
Description copied from interface:SubstanceColorSchemeCreates a hue-shifted (in HSB space) version ofthiscolor scheme.- Specified by:
hueShiftin interfaceSubstanceColorScheme- Parameters:
hueShiftFactor- Value in -1.0...1.0 range.- Returns:
- Hue-shifted version of
thisscheme.
-
getBackgroundFillColor
Description copied from interface:SchemeDerivedColorsReturns the background fill color forthisscheme.- Specified by:
getBackgroundFillColorin interfaceSchemeDerivedColors- Returns:
- The background fill color for
thisscheme.
-
getFocusRingColor
Description copied from interface:SchemeDerivedColorsReturns the focus ring color forthisscheme.- Specified by:
getFocusRingColorin interfaceSchemeDerivedColors- Returns:
- The focus ring color for
thisscheme.
-
getLineColor
Description copied from interface:SchemeDerivedColorsReturns the line color forthisscheme.- Specified by:
getLineColorin interfaceSchemeDerivedColors- Returns:
- The line color for
thisscheme.
-
getSelectionForegroundColor
Description copied from interface:SchemeDerivedColorsReturns the selection foreground color forthisscheme.- Specified by:
getSelectionForegroundColorin interfaceSchemeDerivedColors- Returns:
- The selection foreground color for
thisscheme.
-
getSelectionBackgroundColor
Description copied from interface:SchemeDerivedColorsReturns the selection background color forthisscheme.- Specified by:
getSelectionBackgroundColorin interfaceSchemeDerivedColors- Returns:
- The selection background color for
thisscheme.
-
getWatermarkDarkColor
Description copied from interface:SchemeDerivedColorsReturns the watermark dark color forthisscheme.- Specified by:
getWatermarkDarkColorin interfaceSchemeDerivedColors- Returns:
- Watermark dark color for
thisscheme.
-
getWatermarkLightColor
Description copied from interface:SchemeDerivedColorsReturns the watermark light color forthisscheme.- Specified by:
getWatermarkLightColorin interfaceSchemeDerivedColors- Returns:
- Watermark light color for
thisscheme.
-
getWatermarkStampColor
Description copied from interface:SchemeDerivedColorsReturns the watermark stamp color forthisscheme.- Specified by:
getWatermarkStampColorin interfaceSchemeDerivedColors- Returns:
- Watermark stamp color for
thisscheme.
-
getTextBackgroundFillColor
Description copied from interface:SchemeDerivedColorsReturns the text background fill color forthisscheme.- Specified by:
getTextBackgroundFillColorin interfaceSchemeDerivedColors- Returns:
- The text background fill color for
thisscheme.
-
named
Description copied from interface:SubstanceColorSchemeThis 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 interfaceSubstanceColorScheme- Parameters:
colorSchemeDisplayName- New display name for this color scheme.- Returns:
- This color scheme.
-
toString
-