Class IntColorType.HueIntColorType
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType.HueIntColorType
- Direct Known Subclasses:
ColorTypes.HSL32,ColorTypes.HSV32
- Enclosing class:
IntColorType
A color type that encodes hue and chroma-related values.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.lukebemish.dynamicassetgenerator.api.colors.IntColorType
IntColorType.BlendingIntColorType, IntColorType.HueIntColorType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfromARGB32(int color) inthue(int color) protected abstract floatmakeChroma(int color) protected abstract intmakeColor(int alpha, int hue, float chroma, float xMin, float xMax) Finalized encoding of a color given some parameters.protected abstract floatmakeMatch(int color, float chroma) inttoARGB32(int color)
-
Constructor Details
-
HueIntColorType
public HueIntColorType()
-
-
Method Details
-
makeChroma
@Contract(pure=true) protected abstract float makeChroma(int color) - Returns:
- the chroma from 0 to 1 given a color
-
hue
@Contract(pure=true) public int hue(int color) -
makeMatch
@Contract(pure=true) protected abstract float makeMatch(int color, float chroma) - Returns:
- what needs to be added to each 0 to 1 channel to provide the proper value, given a full color and chroma
-
toARGB32
public int toARGB32(int color) - Specified by:
toARGB32in classIntColorType- Returns:
- the color, encoded as
ColorTypes.ARGB32
-
fromARGB32
public int fromARGB32(int color) - Specified by:
fromARGB32in classIntColorType- Returns:
- the provided
ColorTypes.ARGB32color, encoded as this color type
-
makeColor
@Contract(pure=true) protected abstract int makeColor(int alpha, int hue, float chroma, float xMin, float xMax) Finalized encoding of a color given some parameters.- 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
-