Class Color.Chroma
-
- All Implemented Interfaces:
-
kotlin.Cloneable
public final class Color.Chroma extends Color.Animated
A color that changes over time, in an endless cycle. You can use the saturation and brightness fields to set the tone of the chroma. Some examples:
brightness = 0.2f, saturation = 0.8f-> dark chromabrightness = 0.8f, saturation = 0.8f-> less offensive chroma tone
-
-
Field Summary
Fields Modifier and Type Field Description private final Booleanupdatingprivate final BooleanalwaysUpdatesprivate LongspeedNanosprivate Floathueprivate Floatsaturationprivate Floatbrightnessprivate Floatalphaprivate transient Booleandirtyprivate transient Integerargbprivate final Integerrprivate final Integergprivate final Integerbprivate final Integera
-
Constructor Summary
Constructors Constructor Description Color.Chroma(Long speedNanos, Float brightness, Float saturation, Float alpha, Float initialHue)Color.Chroma(Long speedNanos, Float brightness, Float saturation, Float alpha)Color.Chroma(Long speedNanos, Float brightness, Float saturation)Color.Chroma(Long speedNanos, Float brightness)Color.Chroma(Long speedNanos)Color.Chroma()
-
Method Summary
Modifier and Type Method Description BooleangetUpdating()BooleangetAlwaysUpdates()final LonggetSpeedNanos()the speed of this color, in nanoseconds. final UnitsetSpeedNanos(Long speedNanos)the speed of this color, in nanoseconds. Unitrecolor(Color target, Animation.Type type, Long durationNanos)recolor this color to the target color, with the given animation type and duration. Color.Chromaclone()final Color.Animatedfreeze()Convert this chroma color to a mutable color, which is a snapshot of this color at the time of calling this method. Booleanupdate(Long deltaTimeNanos)update the color animation, if present. -
Methods inherited from class org.polyfrost.polyui.color.Color
equals, getA, getARGB, getAlpha, getB, getBrightness, getDirty, getG, getHue, getR, getSaturation, hashCode, setAlpha, setArgb, setBrightness, setDirty, setHue, setSaturation, take, toString -
Methods inherited from class org.polyfrost.polyui.color.Color.Animated
toAnimatable -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getUpdating
Boolean getUpdating()
-
getAlwaysUpdates
Boolean getAlwaysUpdates()
-
getSpeedNanos
final Long getSpeedNanos()
the speed of this color, in nanoseconds.
The speed refers to the amount of time it takes for this color to complete one cycle, e.g. from red, through to blue, through to green, then back to red.
-
setSpeedNanos
final Unit setSpeedNanos(Long speedNanos)
the speed of this color, in nanoseconds.
The speed refers to the amount of time it takes for this color to complete one cycle, e.g. from red, through to blue, through to green, then back to red.
-
recolor
@Deprecated(message = "Chroma colors cannot be animated.", level = DeprecationLevel.ERROR) Unit recolor(Color target, Animation.Type type, Long durationNanos)
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:
type- animation type.
-
clone
Color.Chroma clone()
-
freeze
final Color.Animated freeze()
Convert this chroma color to a mutable color, which is a snapshot of this color at the time of calling this method.
- Since:
0.19.1
-
-
-
-