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 interfacePolyColor.Gradient.Type
-
Field Summary
Fields Modifier and Type Field Description private PolyColor.Animatedcolor1private PolyColor.Animatedcolor2private final Integerargb1private final Integerargb2private final Booleantransparentprivate final Booleanupdatingprivate final PolyColor.Gradient.Typetypeprivate Floathueprivate Floatsaturationprivate Floatbrightnessprivate Floatalphaprivate transient Booleandirtyprivate final 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 UnitsetColor1(PolyColor.Animated color1)final PolyColor.AnimatedgetColor2()final UnitsetColor2(PolyColor.Animated color2)final IntegergetARGB1()final IntegergetARGB2()BooleangetTransparent()BooleangetUpdating()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 animation)Animated.recolor this gradient color. Unitrecolor(PolyColor target, Animation animation)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
alpha, blue, getARGB, getAlpha, getBrightness, getDirty, getHue, getSaturation, green, red, setAlpha, 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.Gradient
PolyColor.Gradient(PolyColor color1, PolyColor color2, PolyColor.Gradient.Type type)
-
-
Method Detail
-
getColor1
final PolyColor.Animated getColor1()
-
setColor1
final Unit setColor1(PolyColor.Animated color1)
-
getColor2
final PolyColor.Animated getColor2()
-
setColor2
final Unit setColor2(PolyColor.Animated color2)
-
getTransparent
Boolean getTransparent()
-
getUpdating
Boolean getUpdating()
-
getType
final PolyColor.Gradient.Type getType()
-
clone
PolyColor.Gradient clone()
-
recolor
final Unit recolor(Integer whichColor, PolyColor target, Animation animation)
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 animation)
Deprecated, see Component.recolor for how to animate gradients.
- Parameters:
animation- animation to use.
-
-
-
-