Package org.polyfrost.polyui.color
Class PolyColor.Gradient
-
- All Implemented Interfaces:
-
kotlin.Cloneable
public final class PolyColor.Gradient extends PolyColor.Animated
A gradient color.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPolyColor.Gradient.Type
-
Field Summary
Fields Modifier and Type Field Description private final PolyColor.Animatedcolor1private final Integerargb1private final Integerargb2private final PolyColor.Gradient.Typetypeprivate final BooleanalwaysUpdatesprivate final Booleanupdatingprivate Floathueprivate Floatsaturationprivate Floatbrightnessprivate Floatalphaprivate transient Booleandirtyprivate transient Integerargbprivate final Integerrprivate final Integergprivate final Integerbprivate final Integera
-
Constructor Summary
Constructors Constructor Description PolyColor.Gradient(PolyColor color1, PolyColor color2, PolyColor.Gradient.Type type)PolyColor.Gradient(PolyColor color1, PolyColor color2)
-
Method Summary
Modifier and Type Method Description final PolyColor.AnimatedgetColor1()final IntegergetARGB1()final IntegergetARGB2()final PolyColor.Gradient.TypegetType()Booleanequals(Object other)final PolyColorget(Integer index)final Unitset(Integer index, PolyColor color)IntegerhashCode()PolyColor.Gradientclone()final Unitrecolor(Integer whichColor, PolyColor target, Animation.Type type, Long durationNanos)Animated.recolor this gradient color. Unitrecolor(PolyColor target, Animation.Type type, Long durationNanos)Deprecated, see Component.recolor for how to animate gradients. Booleanupdate(Long deltaTimeNanos)update the color animation, if present. -
Methods inherited from class org.polyfrost.polyui.color.PolyColor.Animated
getAlwaysUpdates, getUpdating, toAnimatable -
Methods inherited from class org.polyfrost.polyui.color.PolyColor
getA, getARGB, getAlpha, getB, getBrightness, getDirty, getG, getHue, getR, getSaturation, setAlpha, setArgb, setBrightness, setDirty, setHue, setSaturation, take, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PolyColor.Gradient
PolyColor.Gradient(PolyColor color1, PolyColor color2, PolyColor.Gradient.Type type)
-
-
Method Detail
-
getColor1
final PolyColor.Animated getColor1()
-
getType
final PolyColor.Gradient.Type getType()
-
clone
PolyColor.Gradient clone()
-
recolor
final Unit recolor(Integer whichColor, PolyColor target, Animation.Type type, Long durationNanos)
Animated.recolor this gradient color.
- Parameters:
whichColor- which color to recolor.
-
recolor
@Deprecated(message = "Gradient colors cannot be animated in this way. They can be animated separately using the given method.", replaceWith = @ReplaceWith(imports = {}, expression = "recolor(0, target, type, durationNanos)"), level = DeprecationLevel.ERROR) Unit recolor(PolyColor target, Animation.Type type, Long durationNanos)
Deprecated, see Component.recolor for how to animate gradients.
- Parameters:
type- animation type.
-
-
-
-