Package org.fusesource.jansi.io
Class Colors
java.lang.Object
org.fusesource.jansi.io.Colors
Helper class for dealing with color rounding.
This is a simplified version of the JLine's one at
https://github.com/jline/jline3/blob/a24636dc5de83baa6b65049e8215fb372433b3b1/terminal/src/main/java/org/jline/utils/Colors.java
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]
Default 256 colors paletteprivate static final double
private static final double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static double
cie76
(int c1, int c2) private static double
pivotRgb
(double n) private static double
pivotXyz
(double n) private static double[]
rgb
(int color) private static double[]
rgb2cielab
(double[] rgb) private static double[]
rgb2cielab
(int color) private static double[]
rgb2xyz
(double[] rgb) static int
roundColor
(int col, int max) private static int
roundColor
(int color, int[] colors, int max) static int
roundRgbColor
(int r, int g, int b, int max) private static double
scalar
(double[] c1, double[] c2) private static double
sqr
(double n) private static double[]
xyz2lab
(double[] xyz)
-
Field Details
-
DEFAULT_COLORS_256
public static final int[] DEFAULT_COLORS_256Default 256 colors palette -
epsilon
private static final double epsilon- See Also:
-
kappa
private static final double kappa- See Also:
-
-
Constructor Details
-
Colors
public Colors()
-
-
Method Details
-
roundColor
public static int roundColor(int col, int max) -
roundRgbColor
public static int roundRgbColor(int r, int g, int b, int max) -
roundColor
private static int roundColor(int color, int[] colors, int max) -
cie76
private static double cie76(int c1, int c2) -
scalar
private static double scalar(double[] c1, double[] c2) -
rgb
private static double[] rgb(int color) -
rgb2cielab
private static double[] rgb2cielab(int color) -
rgb2cielab
private static double[] rgb2cielab(double[] rgb) -
rgb2xyz
private static double[] rgb2xyz(double[] rgb) -
pivotRgb
private static double pivotRgb(double n) -
xyz2lab
private static double[] xyz2lab(double[] xyz) -
pivotXyz
private static double pivotXyz(double n) -
sqr
private static double sqr(double n)
-