Class ColorTypes.HSL32
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType.HueIntColorType
dev.lukebemish.dynamicassetgenerator.api.colors.ColorTypes.HSL32
- Enclosing class:
ColorTypes
Colors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, hue, saturation, and
lightness.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
IntColorType.BlendingIntColorType, IntColorType.HueIntColorType -
Method Summary
Modifier and TypeMethodDescriptionintlightness(int color) protected floatmakeChroma(int color) protected intmakeColor(int alpha, int hue, float chroma, float xMin, float xMax) Finalized encoding of a color given some parameters.protected floatmakeMatch(int color, float chroma) intsaturation(int color) Methods inherited from class dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType.HueIntColorType
fromARGB32, hue, toARGB32
-
Method Details
-
saturation
@Contract(pure=true) public int saturation(int color) -
lightness
@Contract(pure=true) public int lightness(int color) -
makeChroma
protected float makeChroma(int color) - Specified by:
makeChromain classIntColorType.HueIntColorType- Returns:
- the chroma from 0 to 1 given a color
-
makeMatch
protected float makeMatch(int color, float chroma) - Specified by:
makeMatchin classIntColorType.HueIntColorType- Returns:
- what needs to be added to each 0 to 1 channel to provide the proper value, given a full color and chroma
-
makeColor
protected int makeColor(int alpha, int hue, float chroma, float xMin, float xMax) Description copied from class:IntColorType.HueIntColorTypeFinalized encoding of a color given some parameters.- Specified by:
makeColorin classIntColorType.HueIntColorType- Parameters:
alpha- alpha value, from 0 to 255hue- hue, from 0 to 255chroma- chroma, from 0 to 1xMin- minimum value of RGB channels, from 0 to 1xMax- maximum value of RGB channels, from 0 to 1- Returns:
- an encoded color
-