Class PolyColor.Animatable

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Unit recolor(PolyColor to, Animation animation) recolor this color to the target color, with the given animation type and duration.
      Boolean update(Long deltaTimeNanos) update the color animation, if present.
      • Methods inherited from class org.polyfrost.polyui.color.PolyColor.Mutable

        equals, getAlpha, getArgb, getBrightness, getHue, getSaturation, hashCode, recolor, setAlpha, setBrightness, setHue, setSaturation, toString
      • Methods inherited from class org.polyfrost.polyui.color.PolyColor

        alpha, blue, getTransparent, green, red
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PolyColor.Animatable

        PolyColor.Animatable(Float hue, Float saturation, Float brightness, Float alpha)
    • Method Detail

      • recolor

         Unit recolor(PolyColor to, Animation animation)

        recolor this color to the target color, with the given animation type and duration.

        make sure to check if the color is a gradient, as this method may not have the expected result!

        Parameters:
        animation - animation to use.
      • update

         Boolean update(Long deltaTimeNanos)

        update the color animation, if present. After, the animation is cleared, and the color becomes static again.

        Returns:

        true if the animation finished on this tick, false if otherwise