fang2.transformers
Class ColorTransformer
java.lang.Object
fang2.transformers.InterpolatorTransformer
fang2.transformers.ColorTransformer
- All Implemented Interfaces:
- Transformer
public class ColorTransformer
- extends InterpolatorTransformer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorTransformer
public ColorTransformer(double transitionTime,
boolean enabled,
Color startColor,
Color endColor)
- Make a
ColorTransformer with the given cycle
and colors.
- Parameters:
transitionTime - transition cycle timeenabled - does it start enabled?startColor - starting colorendColor - ending color
ColorTransformer
public ColorTransformer(double transitionTime,
Color startColor,
Color endColor)
- Make a
ColorTransformer with the given cycle
and colors.
- Parameters:
transitionTime - transition cycle timestartColor - starting colorendColor - ending color
getEndColor
public Color getEndColor()
- Returns:
- the endColor
getStartColor
public Color getStartColor()
- Returns:
- the startColor
setEndColor
public void setEndColor(Color endColor)
- Parameters:
endColor - the endColor to set
setStartColor
public void setStartColor(Color startColor)
- Parameters:
startColor - the startColor to set
updateSprite
public void updateSprite(Sprite sprite)
- Apply the color to the sprite.
- Specified by:
updateSprite in interface Transformer- Specified by:
updateSprite in class InterpolatorTransformer
- Parameters:
sprite - the sprite to update
interpolate
protected void interpolate(double fractionEndColor)
- Update the current color based on interpolated percentage.
- Specified by:
interpolate in class InterpolatorTransformer
- Parameters:
fractionEndColor - the percentage of endColor to use
(remainder comes from startColor)