Class Colors

java.lang.Object
org.fusesource.jansi.io.Colors

public class Colors extends 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 final int[]
    Default 256 colors palette
    private static final double
     
    private static final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 Details

    • DEFAULT_COLORS_256

      public static final int[] DEFAULT_COLORS_256
      Default 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)