Package com.github.weisj.jsvg.util
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 int
computeLuminance
(int r, int g, int b) private static int
convertLinearRGBtoSRGB
(int color, float alpha) Helper function to convert a color component in linear RGB space to SRGB space.private static int
convertSRGBtoLinearRGB
(int color, float alpha) Helper function to convert a color component in sRGB space to linear RGB space.static int
div255
(int x) static void
HSLtoRGB
(float h, float s, float l, int @NotNull [] rgb) private static float
hue2RGB
(float v1, float v2, float vH) static int
linearRGBtoSRGB
(int argb) static int
linearRGBtoSRGBBand
(int value) static void
linearRGBtoSRGBinPlace
(int @NotNull [] argb) static void
linearRGBtoSRGBPreInPlace
(int @NotNull [] argb) static void
RGBPretoHSL
(int r, int g, int b, int a, float @NotNull [] hsl) static int
sRGBtoLinearRGB
(int argb) static int
sRGBtoLinearRGBBand
(int value) static void
sRGBtoLinearRGBinPlace
(int @NotNull [] argb) static void
sRGBtoLinearRGBPreInPlace
(int @NotNull [] argb) static int
toRgbRange
(double value) static String
static 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.
-