Class ColorUtil
java.lang.Object
com.github.weisj.jsvg.util.ColorUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]private static final int[][]private static final int[]private static final int[][]Color space conversion lookup tables. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intclampColor(int v) static intcomputeLuminance(int r, int g, int b) private static intconvertLinearRGBtoSRGB(int color, float alpha) Helper function to convert a color component in linear RGB space to SRGB space.private static intconvertSRGBtoLinearRGB(int color, float alpha) Helper function to convert a color component in sRGB space to linear RGB space.static intdiv255(int x) static voidHSLtoRGB(float h, float s, float l, int @NotNull [] rgb) private static floathue2RGB(float v1, float v2, float vH) static intlinearRGBtoSRGB(int argb) static intlinearRGBtoSRGBBand(int value) static voidlinearRGBtoSRGBinPlace(int @NotNull [] argb) static voidlinearRGBtoSRGBPreInPlace(int @NotNull [] argb) static voidRGBPretoHSL(int r, int g, int b, int a, float @NotNull [] hsl) static intsRGBtoLinearRGB(int argb) static intsRGBtoLinearRGBBand(int value) static voidsRGBtoLinearRGBinPlace(int @NotNull [] argb) static voidsRGBtoLinearRGBPreInPlace(int @NotNull [] argb) static inttoRgbRange(double value) static Stringstatic Color
-
Field Details
-
SRGBtoLinearRGBPre
private static final int[][] SRGBtoLinearRGBPreColor space conversion lookup tables. -
SRGBtoLinearRGB
private static final int[] SRGBtoLinearRGB -
LinearRGBtoSRGBPre
private static final int[][] LinearRGBtoSRGBPre -
LinearRGBtoSRGB
private static final int[] LinearRGBtoSRGB
-
-
Constructor Details
-
ColorUtil
private ColorUtil()
-
-
Method Details
-
div255
public static int div255(int x) -
computeLuminance
public static int computeLuminance(int r, int g, int b) -
toRgbRange
public static int toRgbRange(double value) -
withAlpha
-
toString
-
RGBPretoHSL
public static void RGBPretoHSL(int r, int g, int b, int a, float @NotNull [] hsl) -
HSLtoRGB
public static void HSLtoRGB(float h, float s, float l, int @NotNull [] rgb) -
hue2RGB
private static float hue2RGB(float v1, float v2, float vH) -
sRGBtoLinearRGBinPlace
public static void sRGBtoLinearRGBinPlace(int @NotNull [] argb) -
linearRGBtoSRGBinPlace
public static void linearRGBtoSRGBinPlace(int @NotNull [] argb) -
sRGBtoLinearRGBPreInPlace
public static void sRGBtoLinearRGBPreInPlace(int @NotNull [] argb) -
linearRGBtoSRGBPreInPlace
public static void linearRGBtoSRGBPreInPlace(int @NotNull [] argb) -
sRGBtoLinearRGBBand
public static int sRGBtoLinearRGBBand(int value) -
sRGBtoLinearRGB
public static int sRGBtoLinearRGB(int argb) -
linearRGBtoSRGBBand
public static int linearRGBtoSRGBBand(int value) -
linearRGBtoSRGB
public static int linearRGBtoSRGB(int argb) -
convertSRGBtoLinearRGB
private static int convertSRGBtoLinearRGB(int color, float alpha) Helper function to convert a color component in sRGB space to linear RGB space. Used to build a static lookup table. -
convertLinearRGBtoSRGB
private static int convertLinearRGBtoSRGB(int color, float alpha) Helper function to convert a color component in linear RGB space to SRGB space. Used to build a static lookup table. -
clampColor
public static int clampColor(int v)
-