Package org.polyfrost.polyui.color
Class PolyColor.Mutable
-
- All Implemented Interfaces:
-
org.polyfrost.polyui.color.PolyColor
public class PolyColor.Mutable implements PolyColor
-
-
Constructor Summary
Constructors Constructor Description PolyColor.Mutable(Float hue, Float saturation, Float brightness, Float alpha)
-
Method Summary
Modifier and Type Method Description final FloatgetHue()The hue of this color. final UnitsetHue(Float hue)final FloatgetSaturation()The saturation of this color. final UnitsetSaturation(Float saturation)final FloatgetBrightness()The brightness of this color. final UnitsetBrightness(Float brightness)final FloatgetAlpha()The alpha of this color. final UnitsetAlpha(Float alpha)final IntegergetArgb()return an integer representation of this color. final Unitrecolor(PolyColor to)Booleanupdate(Long deltaTimeNanos)StringtoString()Booleanequals(Object other)IntegerhashCode()-
-
Method Detail
-
getHue
final Float getHue()
The hue of this color. Can be any value, but is
mod 360, so values are always between 0 and 360.
-
getSaturation
final Float getSaturation()
The saturation of this color. Clamped between
0f..1f.
-
setSaturation
final Unit setSaturation(Float saturation)
-
getBrightness
final Float getBrightness()
The brightness of this color. Clamped between
0f..1f.
-
setBrightness
final Unit setBrightness(Float brightness)
-
getArgb
final Integer getArgb()
return an integer representation of this color. Utilizes bit-shifts to store the color as one 32-bit integer, like so:
0bAAAAAAAARRRRRRRRGGGGGGGGBBBBBBBBaka0xAARRGGBB
-
-
-
-