alphaColor
public static AnimationFunction alphaColor(AnimationFunction f,
Color baseColor)
Creates and returns an animation function that returns time-based
sRGB colors that are built from a given base color and
an animation function of alpha values.
Useful for fading effects.
f
- the animation function of alpha valuesbaseColor
- the base color
- an animation function of colors
asFloat
public static AnimationFunctions.FloatFunction asFloat(AnimationFunction f)
Creates a time-based function that wraps the given Float-based animation
function to return the corresponding float values.
f
- the underlying animation function of floats
- an animation function the returns Float objects
concat
public static AnimationFunction concat(AnimationFunction first,
AnimationFunction second)
Concatenates the fiven animation functions and returns a compound
animation function that represents the concatenation.
first
- the concatenation's first AnimationFunctionsecond
- the concatenation's second AnimationFunction
- the concatenated animation function
constant
public static AnimationFunction constant(long duration,
Object value)
Creates and returns an animation function that returns a constant value
over the given duration.
duration
- the function's durationvalue
- the Object that will be returned all the time
- a constant animation function
discrete
public static AnimationFunction discrete(long duration,
Object[] values)
Creates and returns a discrete animation function for the
given duration and values. The values are equally distributed
over the duration.
duration
- the function's durationvalues
- an array of discrete result values
- a discrete animation function
discrete
public static AnimationFunction discrete(long duration,
Object[] values,
float[] keyTimes)
Creates and returns a discrete animation function for the given duration,
values and interpolation key times.
duration
- the function's durationvalues
- an array of discrete result valueskeyTimes
- an array of key times used to distribute the
result values over the time
- a discrete animation function
fromBy
public static AnimationFunction fromBy(long duration,
float from,
float by)
Creates and returns a linear animation function for the given duration
that returns Float in interval [from, from + by].
duration
- the animation durationfrom
- the initial result valueby
- the difference that is added to the initial value
- a linear animation function with values in [from, from + by]
fromTo
public static AnimationFunction fromTo(long duration,
float from,
float to)
Ceates and returns a linear animation function with the given duration.
The function values are Floats in the intervall [from, to].
duration
- the animation durationfrom
- the initial result valueto
- the last result value
- a linear animation function with values in [from, to]
linear
public static AnimationFunction linear(long duration,
Object[] values)
Creates and returns a linear animation function that is defined
by an array of numeric values; these are distributed equally
over the duration.
duration
- the animation durationvalues
- an array of values
- a linear animation function for the given values
linear
public static AnimationFunction linear(long duration,
Object[] values,
float[] keyTimes)
Creates and returns a linear animation function that is defined
by an array of numeric values and an array of relative key times.
duration
- the animation durationvalues
- an array of valueskeyTimes
- an array of key times used to distribute the
result values over the time
- a linear animation function for the given values
linearColors
public static AnimationFunction linearColors(long duration,
Color[] colors,
float[] keyTimes)
Creates an AnimationFunction
that maps times
to instances of Color
. The mapping is interpolated
from an array of Colors using an array of key times.
duration
- the duration of this animation functioncolors
- the colors to interpolate.keyTimes
- an array of key times used to distribute
the result values over the time.
- An
AnimationFunction
that maps times to sRGB colors.
This mapping is defined by an arry of Color
values
and a corresponding array of key times that is used to interpolate
sub-AnimationFunction for the red, green, blue and alpha values.
random
public static AnimationFunction random(int min,
int max,
float changeProbability)
Creates and returns an animation function that returns random values
from the interval [min, max] with a given change probability.
min
- the minimum result valuemax
- the maximum result valuechangeProbability
- the probability that the value changes
- an animation function with random values in [min, max]
repeat
public static AnimationFunction repeat(AnimationFunction f,
long repeatTime)
Creates and returns an animation function that is defined
by repeating the specified animation function.
f
- the animation function to repeatrepeatTime
- the time to repeat the function
- the repeated animation function
reverse
public static AnimationFunction reverse(AnimationFunction f)
Creates and returns an animation function that is defined
by reverting the given animation function in time.
f
- the animation function to reverse
- the reversed animation function