Class Colors


  • public class Colors
    extends java.lang.Object
    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

      Fields 
      Modifier and Type Field Description
      static int[] DEFAULT_COLORS_256
      Default 256 colors palette
      private static double epsilon  
      private static double kappa  
    • Constructor Summary

      Constructors 
      Constructor Description
      Colors()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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​(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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_COLORS_256

        public static final int[] DEFAULT_COLORS_256
        Default 256 colors palette
    • Constructor Detail

      • Colors

        public Colors()
    • Method Detail

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