Class AnimatedColor
java.lang.Object
java.awt.Color
nl.colorize.util.swing.AnimatedColor
- All Implemented Interfaces:
Paint, Transparency, Serializable, Animatable
Color with red, green, blue, and alpha components that change over time.
- See Also:
-
Field Summary
Fields inherited from class Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOWFields inherited from interface Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionAnimatedColor(Color startColor) Creates a newAnimatedColorthat will start out with the RGBA values ofstartColor.AnimatedColor(Color startColor, Color endColor, float duration) Creates a new color with the specified RGBA values.AnimatedColor(Color startColor, Interpolation interpolationMethod) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeyFrame(float time, Color rgba) Adds a key frame that describes the RGBA values of this color at the specified point in time.voidend()intgetAlpha()intgetBlue()intgetGreen()intgetRed()intgetRGB()inthashCode()voidonFrame(float deltaTime) Called every frame update while the animation is active.voidreset()protected voidsetPlayhead(float time) Methods inherited from class Color
brighter, createContext, darker, decode, equals, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getHSBColor, getRGBColorComponents, getRGBComponents, getTransparency, HSBtoRGB, RGBtoHSB, toString
-
Constructor Details
-
AnimatedColor
Creates a newAnimatedColorthat will start out with the RGBA values ofstartColor. Animation can be added to the color by adding key frames. -
AnimatedColor
-
AnimatedColor
-
-
Method Details
-
addKeyFrame
Adds a key frame that describes the RGBA values of this color at the specified point in time. -
onFrame
public void onFrame(float deltaTime) Description copied from interface:AnimatableCalled every frame update while the animation is active.- Specified by:
onFramein interfaceAnimatable- Parameters:
deltaTime- Time since the last frame update, in seconds.
-
setPlayhead
protected void setPlayhead(float time) -
reset
public void reset() -
end
public void end() -
getRed
-
getGreen
-
getBlue
-
getAlpha
-
getRGB
-
hashCode
-