Package com.github.weisj.jsvg.util
Class ColorUtil
- java.lang.Object
-
- com.github.weisj.jsvg.util.ColorUtil
-
public final class ColorUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
LinearRGBtoSRGB
private static int[][]
LinearRGBtoSRGBPre
private static int[]
SRGBtoLinearRGB
private static int[][]
SRGBtoLinearRGBPre
Color space conversion lookup tables.
-
Constructor Summary
Constructors Modifier Constructor Description private
ColorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 java.lang.String
toString(@Nullable java.awt.Color c)
static java.awt.Color
withAlpha(@NotNull java.awt.Color c, float alpha)
-
-
-
Field Detail
-
SRGBtoLinearRGBPre
private static final int[][] SRGBtoLinearRGBPre
Color space conversion lookup tables.
-
SRGBtoLinearRGB
private static final int[] SRGBtoLinearRGB
-
LinearRGBtoSRGBPre
private static final int[][] LinearRGBtoSRGBPre
-
LinearRGBtoSRGB
private static final int[] LinearRGBtoSRGB
-
-
Method Detail
-
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
public static java.awt.Color withAlpha(@NotNull @NotNull java.awt.Color c, float alpha)
-
toString
public static java.lang.String toString(@Nullable @Nullable java.awt.Color c)
-
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.
-
-