Package org.jline.utils
Class Colors
- java.lang.Object
-
- org.jline.utils.Colors
-
public class Colors extends java.lang.ObjectUtility class for color-related operations and definitions.The Colors class provides utility methods and constants for working with colors in terminal applications. It includes color palettes, color name mappings, and methods for color parsing and conversion.
This class defines standard color palettes for different terminal color modes:
- 8 standard ANSI colors
- 256-color indexed palette
- Named color mappings (e.g., "red", "blue", "navy")
It also provides methods for parsing color specifications in various formats, such as RGB hex codes, CSS-style color names, and indexed color references. These utilities help with consistent color handling across different terminal types and color capabilities.
-
-
Field Summary
Fields Modifier and Type Field Description static double[]AdobeRGB_environmentAdobe RGB environmentstatic double[]averageSurroundingAverage surrounding for CAM color spacesstatic intCChromastatic double[]D50D50 illuminant for CAM color spacesstatic double[]D65D65 illuminant for CAM color spacesstatic double[]darkSurroundingDark surrounding for CAM color spacesstatic int[]DEFAULT_COLORS_256Default 256 colors palettestatic int[]DEFAULT_COLORS_88Default 88 colors palettestatic double[]dimSurroundingDim surrounding for CAM color spacesstatic inthHuestatic intHHue Composition / Hue Quadraturestatic intJLightnessstatic intMColorfulnessstatic intQBrightnessstatic intsSaturationstatic double[]sRGB_encoding_environmentsRGB encoding environmentstatic double[]sRGB_typical_environmentsRGB typical environment
-
Constructor Summary
Constructors Constructor Description Colors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]CAT02toHPE(double[] RGB)static double[]rgb2cielab(double[] rgb)static intrgbColor(int col)static java.lang.IntegerrgbColor(java.lang.String name)static introundColor(int col, int max)static introundColor(int col, int max, java.lang.String dist)static introundRgbColor(int r, int g, int b, int max)static voidsetRgbColors(int[] colors)
-
-
-
Field Detail
-
DEFAULT_COLORS_256
public static final int[] DEFAULT_COLORS_256
Default 256 colors palette
-
DEFAULT_COLORS_88
public static final int[] DEFAULT_COLORS_88
Default 88 colors palette
-
D50
public static final double[] D50
D50 illuminant for CAM color spaces
-
D65
public static final double[] D65
D65 illuminant for CAM color spaces
-
averageSurrounding
public static final double[] averageSurrounding
Average surrounding for CAM color spaces
-
dimSurrounding
public static final double[] dimSurrounding
Dim surrounding for CAM color spaces
-
darkSurrounding
public static final double[] darkSurrounding
Dark surrounding for CAM color spaces
-
sRGB_encoding_environment
public static final double[] sRGB_encoding_environment
sRGB encoding environment
-
sRGB_typical_environment
public static final double[] sRGB_typical_environment
sRGB typical environment
-
AdobeRGB_environment
public static final double[] AdobeRGB_environment
Adobe RGB environment
-
J
public static final int J
Lightness- See Also:
- Constant Field Values
-
Q
public static final int Q
Brightness- See Also:
- Constant Field Values
-
C
public static final int C
Chroma- See Also:
- Constant Field Values
-
M
public static final int M
Colorfulness- See Also:
- Constant Field Values
-
s
public static final int s
Saturation- See Also:
- Constant Field Values
-
H
public static final int H
Hue Composition / Hue Quadrature- See Also:
- Constant Field Values
-
h
public static final int h
Hue- See Also:
- Constant Field Values
-
-
Method Detail
-
setRgbColors
public static void setRgbColors(int[] colors)
-
rgbColor
public static int rgbColor(int col)
-
rgbColor
public static java.lang.Integer rgbColor(java.lang.String name)
-
roundColor
public static int roundColor(int col, int max)
-
roundColor
public static int roundColor(int col, int max, java.lang.String dist)
-
roundRgbColor
public static int roundRgbColor(int r, int g, int b, int max)
-
CAT02toHPE
public static double[] CAT02toHPE(double[] RGB)
-
rgb2cielab
public static double[] rgb2cielab(double[] rgb)
-
-