Top Description Fields Constructors Methods
org.fusesource.jansi.io

public Class Colors

extends Object
Class Inheritance

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

Modifier and TypeField and Description
public static final int[]
DEFAULT_COLORS_256

Default 256 colors palette

private static final double
private static final double

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private 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(int color)

private static double[]
rgb2cielab(double[] rgb)

private static double[]
rgb2xyz(double[] rgb)

public static int
roundColor(int col, int max)

private static int
roundColor(int color, int[] colors, int max)

public 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)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_COLORS_256back to summary
public static final int[] DEFAULT_COLORS_256

Default 256 colors palette

epsilonback to summary
private static final double epsilon
kappaback to summary
private static final double kappa

Constructor Detail

Colorsback to summary
public Colors()

Method Detail

cie76back to summary
private static double cie76(int c1, int c2)
pivotRgbback to summary
private static double pivotRgb(double n)
pivotXyzback to summary
private static double pivotXyz(double n)
rgbback to summary
private static double[] rgb(int color)
rgb2cielabback to summary
private static double[] rgb2cielab(int color)
rgb2cielabback to summary
private static double[] rgb2cielab(double[] rgb)
rgb2xyzback to summary
private static double[] rgb2xyz(double[] rgb)
roundColorback to summary
public static int roundColor(int col, int max)
roundColorback to summary
private static int roundColor(int color, int[] colors, int max)
roundRgbColorback to summary
public static int roundRgbColor(int r, int g, int b, int max)
scalarback to summary
private static double scalar(double[] c1, double[] c2)
sqrback to summary
private static double sqr(double n)
xyz2labback to summary
private static double[] xyz2lab(double[] xyz)