Class ARGB
java.lang.Object
net.ixdarklord.coolcatcore.api.utils.ARGB
Packed ARGB colour helpers: the parts of newer Minecraft's
net.minecraft.util.ARGB that CoolCatLib uses, for
1.20.1, which only has FastColor.ARGB32.-
Method Summary
Modifier and TypeMethodDescriptionstatic intalpha(int color) static floatalphaFloat(int color) static intas8BitChannel(float value) static intblue(int color) static floatblueFloat(int color) static intcolor(int alpha, int rgb) rgbwith the given alpha (0-255).static intcolor(int red, int green, int blue) static intcolor(int alpha, int red, int green, int blue) static intcolorFromFloat(float alpha, float red, float green, float blue) static intgreen(int color) static floatgreenFloat(int color) static intlerp(float delta, int from, int to) Linear interpolation of each channel, fromfrom(at 0) toto(at 1).static intmultiply(int a, int b) Channel by channel product of two colours.static intmultiplyAlpha(int color, float alphaMultiplier) static intopaque(int color) static intred(int color) static floatredFloat(int color) static intscaleRGB(int color, float scale) static intsrgbLerp(float delta, int from, int to) Interpolation in sRGB space, like newer Minecraft'sARGB.srgbLerp: each channel, linearly.static inttransparent(int color) static intwhite(float alpha)
-
Method Details
-
alpha
public static int alpha(int color) -
red
public static int red(int color) -
green
public static int green(int color) -
blue
public static int blue(int color) -
color
public static int color(int alpha, int red, int green, int blue) -
color
public static int color(int red, int green, int blue) -
color
public static int color(int alpha, int rgb) rgbwith the given alpha (0-255). -
opaque
public static int opaque(int color) -
transparent
public static int transparent(int color) -
alphaFloat
public static float alphaFloat(int color) -
redFloat
public static float redFloat(int color) -
greenFloat
public static float greenFloat(int color) -
blueFloat
public static float blueFloat(int color) -
as8BitChannel
public static int as8BitChannel(float value) -
colorFromFloat
public static int colorFromFloat(float alpha, float red, float green, float blue) -
white
public static int white(float alpha) -
multiply
public static int multiply(int a, int b) Channel by channel product of two colours. -
multiplyAlpha
public static int multiplyAlpha(int color, float alphaMultiplier) -
scaleRGB
public static int scaleRGB(int color, float scale) -
lerp
public static int lerp(float delta, int from, int to) Linear interpolation of each channel, fromfrom(at 0) toto(at 1). -
srgbLerp
public static int srgbLerp(float delta, int from, int to) Interpolation in sRGB space, like newer Minecraft'sARGB.srgbLerp: each channel, linearly.
-