Class ColorBlindUtils


  • public class ColorBlindUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static double[][] lmsToRgb
      Matrix for converting LMS to RGB.
      private static double[][] rgbToLms
      Matrix for converting RGB to LMS.
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorBlindUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.Color getColorBlindColor​(java.awt.Color orig, ColorBlindnessKind kind)
      Converts the specified color into color-blind version.
      private static double[] mult3​(double[][] matrix, double[] vector)
      Multiplies the specified 3x3 matrix by the specified 3x1 vector.
      • Methods inherited from class java.lang.Object

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

      • rgbToLms

        private static double[][] rgbToLms
        Matrix for converting RGB to LMS.
      • lmsToRgb

        private static double[][] lmsToRgb
        Matrix for converting LMS to RGB.
    • Constructor Detail

      • ColorBlindUtils

        public ColorBlindUtils()
    • Method Detail

      • getColorBlindColor

        public static java.awt.Color getColorBlindColor​(java.awt.Color orig,
                                                        ColorBlindnessKind kind)
        Converts the specified color into color-blind version.
        Parameters:
        orig - The original color.
        kind - Color-blindness kind.
        Returns:
        Color-blind version of the original color.
      • mult3

        private static double[] mult3​(double[][] matrix,
                                      double[] vector)
        Multiplies the specified 3x3 matrix by the specified 3x1 vector.
        Parameters:
        matrix - Matrix.
        vector - Vector.
        Returns:
        Vector multiplication.