Package net.infonode.gui.colorprovider
Class ColorBlender
- java.lang.Object
-
- net.infonode.gui.colorprovider.AbstractColorProvider
-
- net.infonode.gui.colorprovider.ColorBlender
-
- All Implemented Interfaces:
java.io.Serializable,ColorProvider
public class ColorBlender extends AbstractColorProvider
Blends two colors according to the given blend amount.- Version:
- $Revision: 1.6 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private floatblendAmountprivate ColorProvidercolor1private ColorProvidercolor2private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ColorBlender(ColorProvider color1, ColorProvider color2, float blendAmount)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorgetColor()Returns the default color when no component is available.java.awt.ColorgetColor(java.awt.Component component)Returns the color obtained from the given component.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
color1
private final ColorProvider color1
-
color2
private final ColorProvider color2
-
blendAmount
private final float blendAmount
-
-
Constructor Detail
-
ColorBlender
public ColorBlender(ColorProvider color1, ColorProvider color2, float blendAmount)
Constructor.- Parameters:
color1- provides the first colorcolor2- provides the second colorblendAmount- the blend amount, range 0 - 1 where 0 means only the first color and 1 means only the second color
-
-
Method Detail
-
getColor
public java.awt.Color getColor(java.awt.Component component)
Description copied from interface:ColorProviderReturns the color obtained from the given component.- Specified by:
getColorin interfaceColorProvider- Overrides:
getColorin classAbstractColorProvider- Parameters:
component- the component- Returns:
- the color obtained from the given component
-
getColor
public java.awt.Color getColor()
Description copied from interface:ColorProviderReturns the default color when no component is available.- Specified by:
getColorin interfaceColorProvider- Overrides:
getColorin classAbstractColorProvider- Returns:
- the default color when no component is available
-
-