Class ColorHelper

java.lang.Object
net.minecraft.util.math.ColorHelper

public class ColorHelper extends Object
Contains color-related helper methods that mostly use ARGB colors represented as 0xAARRGGBB.
Mappings:
Namespace Name
named net/minecraft/util/math/ColorHelper
intermediary net/minecraft/class_9848
official bek
  • Field Details

    • LINEAR_TO_SRGB_LUT_LENGTH

      private static final int LINEAR_TO_SRGB_LUT_LENGTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named LINEAR_TO_SRGB_LUT_LENGTH Lnet/minecraft/util/math/ColorHelper;LINEAR_TO_SRGB_LUT_LENGTH:I
      intermediary field_63677 Lnet/minecraft/class_9848;field_63677:I
      official a Lbek;a:I
    • SRGB_TO_LINEAR

      private static final short[] SRGB_TO_LINEAR
      Mappings:
      Namespace Name Mixin selector
      named SRGB_TO_LINEAR Lnet/minecraft/util/math/ColorHelper;SRGB_TO_LINEAR:[S
      intermediary field_63678 Lnet/minecraft/class_9848;field_63678:[S
      official b Lbek;b:[S
    • LINEAR_TO_SRGB

      private static final byte[] LINEAR_TO_SRGB
      Mappings:
      Namespace Name Mixin selector
      named LINEAR_TO_SRGB Lnet/minecraft/util/math/ColorHelper;LINEAR_TO_SRGB:[B
      intermediary field_63679 Lnet/minecraft/class_9848;field_63679:[B
      official c Lbek;c:[B
  • Constructor Details

    • ColorHelper

      public ColorHelper()
  • Method Details

    • computeSrgbToLinear

      private static float computeSrgbToLinear(float srgb)
      Mappings:
      Namespace Name Mixin selector
      named computeSrgbToLinear Lnet/minecraft/util/math/ColorHelper;computeSrgbToLinear(F)F
      intermediary method_75610 Lnet/minecraft/class_9848;method_75610(F)F
      official e Lbek;e(F)F
    • computeLinearToSrgb

      private static float computeLinearToSrgb(float linear)
      Mappings:
      Namespace Name Mixin selector
      named computeLinearToSrgb Lnet/minecraft/util/math/ColorHelper;computeLinearToSrgb(F)F
      intermediary method_75611 Lnet/minecraft/class_9848;method_75611(F)F
      official f Lbek;f(F)F
    • srgbToLinear

      public static float srgbToLinear(int srgb)
      Mappings:
      Namespace Name Mixin selector
      named srgbToLinear Lnet/minecraft/util/math/ColorHelper;srgbToLinear(I)F
      intermediary method_75600 Lnet/minecraft/class_9848;method_75600(I)F
      official a Lbek;a(I)F
    • linearToSrgb

      public static int linearToSrgb(float linear)
      Mappings:
      Namespace Name Mixin selector
      named linearToSrgb Lnet/minecraft/util/math/ColorHelper;linearToSrgb(F)I
      intermediary method_75599 Lnet/minecraft/class_9848;method_75599(F)I
      official a Lbek;a(F)I
    • interpolate

      public static int interpolate(int a, int b, int c, int d)
      Mappings:
      Namespace Name Mixin selector
      named interpolate Lnet/minecraft/util/math/ColorHelper;interpolate(IIII)I
      intermediary method_75602 Lnet/minecraft/class_9848;method_75602(IIII)I
      official a Lbek;a(IIII)I
    • averageSrgbIntensities

      private static int averageSrgbIntensities(int a, int b, int c, int d)
      Mappings:
      Namespace Name Mixin selector
      named averageSrgbIntensities Lnet/minecraft/util/math/ColorHelper;averageSrgbIntensities(IIII)I
      intermediary method_75609 Lnet/minecraft/class_9848;method_75609(IIII)I
      official c Lbek;c(IIII)I
    • getAlpha

      public static int getAlpha(int argb)
      Returns:
      the alpha value of argb

      The returned value is between 0 and 255 (both inclusive).

      Mappings:
      Namespace Name Mixin selector
      named getAlpha Lnet/minecraft/util/math/ColorHelper;getAlpha(I)I
      intermediary method_61320 Lnet/minecraft/class_9848;method_61320(I)I
      official b Lbek;b(I)I
    • getRed

      public static int getRed(int argb)
      Returns:
      the red value of argb

      The returned value is between 0 and 255 (both inclusive).

      Mappings:
      Namespace Name Mixin selector
      named getRed Lnet/minecraft/util/math/ColorHelper;getRed(I)I
      intermediary method_61327 Lnet/minecraft/class_9848;method_61327(I)I
      official c Lbek;c(I)I
    • getGreen

      public static int getGreen(int argb)
      Returns:
      the green value of argb

      The returned value is between 0 and 255 (both inclusive).

      Mappings:
      Namespace Name Mixin selector
      named getGreen Lnet/minecraft/util/math/ColorHelper;getGreen(I)I
      intermediary method_61329 Lnet/minecraft/class_9848;method_61329(I)I
      official d Lbek;d(I)I
    • getBlue

      public static int getBlue(int argb)
      Returns:
      the blue value of argb

      The returned value is between 0 and 255 (both inclusive).

      Mappings:
      Namespace Name Mixin selector
      named getBlue Lnet/minecraft/util/math/ColorHelper;getBlue(I)I
      intermediary method_61331 Lnet/minecraft/class_9848;method_61331(I)I
      official e Lbek;e(I)I
    • getArgb

      public static int getArgb(int alpha, int red, int green, int blue)
      Returns:
      the ARGB color value from its components
      Mappings:
      Namespace Name Mixin selector
      named getArgb Lnet/minecraft/util/math/ColorHelper;getArgb(IIII)I
      intermediary method_61324 Lnet/minecraft/class_9848;method_61324(IIII)I
      official b Lbek;b(IIII)I
    • getArgb

      public static int getArgb(int red, int green, int blue)
      Returns:
      the full alpha ARGB color value from its components
      Mappings:
      Namespace Name Mixin selector
      named getArgb Lnet/minecraft/util/math/ColorHelper;getArgb(III)I
      intermediary method_61323 Lnet/minecraft/class_9848;method_61323(III)I
      official a Lbek;a(III)I
    • getArgb

      public static int getArgb(Vec3d rgb)
      Mappings:
      Namespace Name Mixin selector
      named getArgb Lnet/minecraft/util/math/ColorHelper;getArgb(Lnet/minecraft/util/math/Vec3d;)I
      intermediary method_61325 Lnet/minecraft/class_9848;method_61325(Lnet/minecraft/class_243;)I
      official a Lbek;a(Lfrz;)I
    • mix

      public static int mix(int first, int second)
      Mappings:
      Namespace Name Mixin selector
      named mix Lnet/minecraft/util/math/ColorHelper;mix(II)I
      intermediary method_61322 Lnet/minecraft/class_9848;method_61322(II)I
      official a Lbek;a(II)I
    • add

      public static int add(int a, int b)
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/ColorHelper;add(II)I
      intermediary method_75606 Lnet/minecraft/class_9848;method_75606(II)I
      official b Lbek;b(II)I
    • subtract

      public static int subtract(int a, int b)
      Mappings:
      Namespace Name Mixin selector
      named subtract Lnet/minecraft/util/math/ColorHelper;subtract(II)I
      intermediary method_75608 Lnet/minecraft/class_9848;method_75608(II)I
      official c Lbek;c(II)I
    • scaleAlpha

      public static int scaleAlpha(int argb, float scale)
      Mappings:
      Namespace Name Mixin selector
      named scaleAlpha Lnet/minecraft/util/math/ColorHelper;scaleAlpha(IF)I
      intermediary method_75601 Lnet/minecraft/class_9848;method_75601(IF)I
      official a Lbek;a(IF)I
    • scaleRgb

      public static int scaleRgb(int argb, float scale)
      Mappings:
      Namespace Name Mixin selector
      named scaleRgb Lnet/minecraft/util/math/ColorHelper;scaleRgb(IF)I
      intermediary method_61321 Lnet/minecraft/class_9848;method_61321(IF)I
      official b Lbek;b(IF)I
    • scaleRgb

      public static int scaleRgb(int argb, float redScale, float greenScale, float blueScale)
      Mappings:
      Namespace Name Mixin selector
      named scaleRgb Lnet/minecraft/util/math/ColorHelper;scaleRgb(IFFF)I
      intermediary method_64602 Lnet/minecraft/class_9848;method_64602(IFFF)I
      official a Lbek;a(IFFF)I
    • scaleRgb

      public static int scaleRgb(int argb, int scale)
      Mappings:
      Namespace Name Mixin selector
      named scaleRgb Lnet/minecraft/util/math/ColorHelper;scaleRgb(II)I
      intermediary method_61328 Lnet/minecraft/class_9848;method_61328(II)I
      official d Lbek;d(II)I
    • grayscale

      public static int grayscale(int argb)
      Mappings:
      Namespace Name Mixin selector
      named grayscale Lnet/minecraft/util/math/ColorHelper;grayscale(I)I
      intermediary method_61333 Lnet/minecraft/class_9848;method_61333(I)I
      official f Lbek;f(I)I
    • method_76063

      public static int method_76063(int int2, int int3)
      Mappings:
      Namespace Name Mixin selector
      named method_76063 Lnet/minecraft/util/math/ColorHelper;method_76063(II)I
      intermediary method_76063 Lnet/minecraft/class_9848;method_76063(II)I
      official e Lbek;e(II)I
    • method_76062

      private static int method_76062(int int2, int int3, int int4, int int5)
      Mappings:
      Namespace Name Mixin selector
      named method_76062 Lnet/minecraft/util/math/ColorHelper;method_76062(IIII)I
      intermediary method_76062 Lnet/minecraft/class_9848;method_76062(IIII)I
      official d Lbek;d(IIII)I
    • lerp

      public static int lerp(float delta, int start, int end)
      Interpolates between two colors in sRGB space.
      Mappings:
      Namespace Name Mixin selector
      named lerp Lnet/minecraft/util/math/ColorHelper;lerp(FII)I
      intermediary method_61319 Lnet/minecraft/class_9848;method_61319(FII)I
      official a Lbek;a(FII)I
    • lerpLinear

      public static int lerpLinear(float delta, int start, int end)
      Interpolates between two colors in linear space.
      Mappings:
      Namespace Name Mixin selector
      named lerpLinear Lnet/minecraft/util/math/ColorHelper;lerpLinear(FII)I
      intermediary method_75605 Lnet/minecraft/class_9848;method_75605(FII)I
      official b Lbek;b(FII)I
    • fullAlpha

      public static int fullAlpha(int argb)
      Mappings:
      Namespace Name Mixin selector
      named fullAlpha Lnet/minecraft/util/math/ColorHelper;fullAlpha(I)I
      intermediary method_61334 Lnet/minecraft/class_9848;method_61334(I)I
      official g Lbek;g(I)I
    • zeroAlpha

      public static int zeroAlpha(int argb)
      Mappings:
      Namespace Name Mixin selector
      named zeroAlpha Lnet/minecraft/util/math/ColorHelper;zeroAlpha(I)I
      intermediary method_61335 Lnet/minecraft/class_9848;method_61335(I)I
      official h Lbek;h(I)I
    • withAlpha

      public static int withAlpha(int alpha, int rgb)
      Mappings:
      Namespace Name Mixin selector
      named withAlpha Lnet/minecraft/util/math/ColorHelper;withAlpha(II)I
      intermediary method_61330 Lnet/minecraft/class_9848;method_61330(II)I
      official f Lbek;f(II)I
    • withAlpha

      public static int withAlpha(float alpha, int color)
      Mappings:
      Namespace Name Mixin selector
      named withAlpha Lnet/minecraft/util/math/ColorHelper;withAlpha(FI)I
      intermediary method_71346 Lnet/minecraft/class_9848;method_71346(FI)I
      official a Lbek;a(FI)I
    • getWhite

      public static int getWhite(float alpha)
      Mappings:
      Namespace Name Mixin selector
      named getWhite Lnet/minecraft/util/math/ColorHelper;getWhite(F)I
      intermediary method_61317 Lnet/minecraft/class_9848;method_61317(F)I
      official b Lbek;b(F)I
    • whiteWithAlpha

      public static int whiteWithAlpha(int alpha)
      Mappings:
      Namespace Name Mixin selector
      named whiteWithAlpha Lnet/minecraft/util/math/ColorHelper;whiteWithAlpha(I)I
      intermediary method_75612 Lnet/minecraft/class_9848;method_75612(I)I
      official i Lbek;i(I)I
    • toAlpha

      public static int toAlpha(float alpha)
      Mappings:
      Namespace Name Mixin selector
      named toAlpha Lnet/minecraft/util/math/ColorHelper;toAlpha(F)I
      intermediary method_75607 Lnet/minecraft/class_9848;method_75607(F)I
      official c Lbek;c(F)I
    • toAlpha

      public static int toAlpha(int alpha)
      Mappings:
      Namespace Name Mixin selector
      named toAlpha Lnet/minecraft/util/math/ColorHelper;toAlpha(I)I
      intermediary method_75613 Lnet/minecraft/class_9848;method_75613(I)I
      official j Lbek;j(I)I
    • fromFloats

      public static int fromFloats(float alpha, float red, float green, float blue)
      Mappings:
      Namespace Name Mixin selector
      named fromFloats Lnet/minecraft/util/math/ColorHelper;fromFloats(FFFF)I
      intermediary method_61318 Lnet/minecraft/class_9848;method_61318(FFFF)I
      official a Lbek;a(FFFF)I
    • toVector

      public static Vector3f toVector(int rgb)
      Mappings:
      Namespace Name Mixin selector
      named toVector Lnet/minecraft/util/math/ColorHelper;toVector(I)Lorg/joml/Vector3f;
      intermediary method_64963 Lnet/minecraft/class_9848;method_64963(I)Lorg/joml/Vector3f;
      official k Lbek;k(I)Lorg/joml/Vector3f;
    • average

      public static int average(int first, int second)
      Mappings:
      Namespace Name Mixin selector
      named average Lnet/minecraft/util/math/ColorHelper;average(II)I
      intermediary method_61332 Lnet/minecraft/class_9848;method_61332(II)I
      official g Lbek;g(II)I
    • channelFromFloat

      public static int channelFromFloat(float value)
      Mappings:
      Namespace Name Mixin selector
      named channelFromFloat Lnet/minecraft/util/math/ColorHelper;channelFromFloat(F)I
      intermediary method_61326 Lnet/minecraft/class_9848;method_61326(F)I
      official d Lbek;d(F)I
    • getAlphaFloat

      public static float getAlphaFloat(int argb)
      Mappings:
      Namespace Name Mixin selector
      named getAlphaFloat Lnet/minecraft/util/math/ColorHelper;getAlphaFloat(I)F
      intermediary method_65100 Lnet/minecraft/class_9848;method_65100(I)F
      official l Lbek;l(I)F
    • getRedFloat

      public static float getRedFloat(int argb)
      Mappings:
      Namespace Name Mixin selector
      named getRedFloat Lnet/minecraft/util/math/ColorHelper;getRedFloat(I)F
      intermediary method_65101 Lnet/minecraft/class_9848;method_65101(I)F
      official m Lbek;m(I)F
    • getGreenFloat

      public static float getGreenFloat(int argb)
      Mappings:
      Namespace Name Mixin selector
      named getGreenFloat Lnet/minecraft/util/math/ColorHelper;getGreenFloat(I)F
      intermediary method_65102 Lnet/minecraft/class_9848;method_65102(I)F
      official n Lbek;n(I)F
    • getBlueFloat

      public static float getBlueFloat(int argb)
      Mappings:
      Namespace Name Mixin selector
      named getBlueFloat Lnet/minecraft/util/math/ColorHelper;getBlueFloat(I)F
      intermediary method_65103 Lnet/minecraft/class_9848;method_65103(I)F
      official o Lbek;o(I)F
    • floatFromChannel

      private static float floatFromChannel(int channel)
      Mappings:
      Namespace Name Mixin selector
      named floatFromChannel Lnet/minecraft/util/math/ColorHelper;floatFromChannel(I)F
      intermediary method_61336 Lnet/minecraft/class_9848;method_61336(I)F
      official r Lbek;r(I)F
    • toAbgr

      public static int toAbgr(int argb)
      Mappings:
      Namespace Name Mixin selector
      named toAbgr Lnet/minecraft/util/math/ColorHelper;toAbgr(I)I
      intermediary method_61337 Lnet/minecraft/class_9848;method_61337(I)I
      official p Lbek;p(I)I
    • fromAbgr

      public static int fromAbgr(int abgr)
      Mappings:
      Namespace Name Mixin selector
      named fromAbgr Lnet/minecraft/util/math/ColorHelper;fromAbgr(I)I
      intermediary method_61338 Lnet/minecraft/class_9848;method_61338(I)I
      official q Lbek;q(I)I
    • withBrightness

      public static int withBrightness(int argb, float brightness)
      Mappings:
      Namespace Name Mixin selector
      named withBrightness Lnet/minecraft/util/math/ColorHelper;withBrightness(IF)I
      intermediary method_70658 Lnet/minecraft/class_9848;method_70658(IF)I
      official c Lbek;c(IF)I