Class LongColorType.HueLongColorType
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType
dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType.HueLongColorType
- Direct Known Subclasses:
ColorTypes.HSL64,ColorTypes.HSV64
- Enclosing class:
LongColorType
A color type that encodes hue and chroma-related values.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.lukebemish.dynamicassetgenerator.api.colors.LongColorType
LongColorType.BlendingLongColorType, LongColorType.HueLongColorType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongfromARGB64(long color) inthue(long color) protected abstract floatmakeChroma(long color) protected abstract longmakeColor(int alpha, int hue, float chroma, float xMin, float xMax) Finalized encoding of a color given some parameters.protected abstract floatmakeMatch(long color, float chroma) longtoARGB64(long color)
-
Constructor Details
-
HueLongColorType
public HueLongColorType()
-
-
Method Details
-
makeChroma
@Contract(pure=true) protected abstract float makeChroma(long color) - Returns:
- the chroma from 0 to 1 given a color
-
hue
@Contract(pure=true) public int hue(long color) -
makeMatch
@Contract(pure=true) protected abstract float makeMatch(long 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
-
toARGB64
public long toARGB64(long color) - Specified by:
toARGB64in classLongColorType- Returns:
- the color, encoded as
ColorTypes.ARGB64
-
fromARGB64
public long fromARGB64(long color) - Specified by:
fromARGB64in classLongColorType- Returns:
- the provided
ColorTypes.ARGB64color, encoded as this color type
-
makeColor
@Contract(pure=true) protected abstract long makeColor(int alpha, int hue, float chroma, float xMin, float xMax) Finalized encoding of a color given some parameters.- Parameters:
alpha- alpha value, from 0x0000 to 0xFFFFhue- hue, from 0x0000 to 0xFFFFchroma- 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
-