Class PolyColor.Chroma
-
- All Implemented Interfaces:
-
kotlin.Cloneable
public final class PolyColor.Chroma extends PolyColor.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 PolyColor.Chroma(Long speedNanos, Float brightness, Float saturation, Float alpha, Float initialHue)PolyColor.Chroma(Long speedNanos, Float brightness, Float saturation, Float alpha)PolyColor.Chroma(Long speedNanos, Float brightness, Float saturation)PolyColor.Chroma(Long speedNanos, Float brightness)PolyColor.Chroma(Long speedNanos)PolyColor.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(PolyColor target, Animation.Type type, Long durationNanos)recolor this color to the target color, with the given animation type and duration. PolyColor.Chromaclone()final PolyColor.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.PolyColor
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.PolyColor.Animated
toAnimatable -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PolyColor.Chroma
PolyColor.Chroma(Long speedNanos, Float brightness, Float saturation, Float alpha, Float initialHue)
- Parameters:
initialHue- the initial hue of the color, being any float value.
-
PolyColor.Chroma
PolyColor.Chroma(Long speedNanos)
-
PolyColor.Chroma
PolyColor.Chroma()
-
-
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(PolyColor 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
PolyColor.Chroma clone()
-
freeze
final PolyColor.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
-
-
-
-