Class AnimatedColor

java.lang.Object
java.awt.Color
nl.colorize.util.swing.AnimatedColor
All Implemented Interfaces:
Paint, Transparency, Serializable, Animatable

public class AnimatedColor extends Color implements Animatable
Color with red, green, blue, and alpha components that change over time.
See Also:
  • Constructor Details

    • AnimatedColor

      public AnimatedColor(Color startColor)
      Creates a new AnimatedColor that will start out with the RGBA values of startColor. Animation can be added to the color by adding key frames.
    • AnimatedColor

      public AnimatedColor(Color startColor, Interpolation interpolationMethod)
    • AnimatedColor

      public AnimatedColor(Color startColor, Color endColor, float duration)
      Creates a new color with the specified RGBA values. The actual appearance of the color will be determined by the state of the animation.
  • Method Details

    • addKeyFrame

      public void addKeyFrame(float time, Color rgba)
      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: Animatable
      Called every frame update while the animation is active.
      Specified by:
      onFrame in interface Animatable
      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

      public int getRed()
      Overrides:
      getRed in class Color
    • getGreen

      public int getGreen()
      Overrides:
      getGreen in class Color
    • getBlue

      public int getBlue()
      Overrides:
      getBlue in class Color
    • getAlpha

      public int getAlpha()
      Overrides:
      getAlpha in class Color
    • getRGB

      public int getRGB()
      Overrides:
      getRGB in class Color
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Color