Class ColorTypes
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.ColorTypes
A collection of color encodings, with tools for converting between them.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classColors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, blue, green, and red.static final classColors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, blue, green, and red.static final classColors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, red, green, and blue.static final classColors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, red, green, and blue.static final classColors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, and the "L", "a", and "b" channels of a CIELAB encoding.static final classColors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, and the "L", "a", and "b" channels of a CIELAB encoding.static classTool for making conversions between 32-bit color spaces more performant.static classTool for making conversions between 64-bit color spaces more performant.static final classColors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, hue, saturation, and lightness.static final classColors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, hue, saturation, and lightness.static classColors encoded with the least significant 32 bits representing 4 8-bit channels: alpha, hue, saturation, and value.static classColors encoded with the least significant 64 bits representing 4 16-bit channels: alpha, hue, saturation, and value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorTypes.ABGR32static final ColorTypes.ABGR64static final ColorTypes.ARGB32static final ColorTypes.ARGB64static final ColorTypes.CIELAB32static final ColorTypes.CIELAB64static final ColorTypes.HSL32static final ColorTypes.HSL64static final ColorTypes.HSV32static final ColorTypes.HSV64 -
Method Summary
Modifier and TypeMethodDescriptionstatic intclamp16(int value) static intclamp8(int value) static intdelinearize16(double value) static intdelinearize8(double value) static intdemote(long color) static doublelinearize16(int value) static doublelinearize8(int value) static longpromote(int color)
-
Field Details
-
ARGB32
-
ABGR32
-
HSL32
-
HSV32
-
CIELAB32
-
ARGB64
-
ABGR64
-
HSL64
-
HSV64
-
CIELAB64
-
-
Method Details
-
clamp8
@Contract(pure=true) public static int clamp8(int value) - Returns:
- the provided value, clamped to the range [0x00, 0xFF]
-
clamp16
@Contract(pure=true) public static int clamp16(int value) - Returns:
- the provided value, clamped to the range [0x0000, 0xFFFF]
-
linearize8
@Contract(pure=true) public static double linearize8(int value) - Returns:
- the provided 8-bit channel of an sRGB color in linearized form
-
delinearize8
@Contract(pure=true) public static int delinearize8(double value) - Returns:
- the provided 8-bit channel of a linear RGB color in sRGB form
-
linearize16
@Contract(pure=true) public static double linearize16(int value) - Returns:
- the provided 16-bit channel of an sRGB color in linearized form
-
delinearize16
@Contract(pure=true) public static int delinearize16(double value) - Returns:
- the provided 16-bit channel of a linear RGB color in sRGB form
-
demote
@Contract(pure=true) public static int demote(long color) - Returns:
- the closest 32-bit approximation of the provided 64-bit color
-
promote
@Contract(pure=true) public static long promote(int color) - Returns:
- a 64-bit approximation of the provided 32-bit color
-