Class ColorHelper


  • public class ColorHelper
    extends java.lang.Object
    Helper class for dealing with colors.
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.Color brighter​(java.awt.Color color)  
      static java.awt.Color brighter​(java.awt.Color color, double factor)  
      static float brightness​(java.awt.Color color)  
      static boolean compatible​(java.awt.Color a, java.awt.Color b)  
      static java.awt.Color darker​(java.awt.Color color, double factor)  
      static java.awt.Color desaturateColor​(java.awt.Color color)  
      static java.awt.Color desaturateColor​(java.awt.Color color, float saturationMutliplier, float brightnessMultiplier)  
      static float diff​(java.awt.Color c1, java.awt.Color c2)  
      static java.lang.String getHTMLColor​(java.awt.Color c)  
      static int intLerp​(int dest, int src, int alpha)  
      static int intMult​(int a, int b)  
      static int intPrelerp​(int dest, int src, int alpha)  
      static int Inva​(int a, int c)  
      static double lum​(java.awt.Color color)  
      static float luminance​(java.awt.Color color)  
      static java.awt.Color parseHTMLColor​(java.lang.String c)  
      static java.awt.Color replaceBrightness​(java.awt.Color color, double brightness)  
      static java.awt.Color toGray​(java.awt.Color color)  
      • Methods inherited from class java.lang.Object

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

      • ColorHelper

        public ColorHelper()
    • Method Detail

      • intMult

        public static int intMult​(int a,
                                  int b)
      • Inva

        public static int Inva​(int a,
                               int c)
      • intPrelerp

        public static int intPrelerp​(int dest,
                                     int src,
                                     int alpha)
      • intLerp

        public static int intLerp​(int dest,
                                  int src,
                                  int alpha)
      • desaturateColor

        public static java.awt.Color desaturateColor​(java.awt.Color color)
      • desaturateColor

        public static java.awt.Color desaturateColor​(java.awt.Color color,
                                                     float saturationMutliplier,
                                                     float brightnessMultiplier)
      • darker

        public static java.awt.Color darker​(java.awt.Color color,
                                            double factor)
      • brighter

        public static java.awt.Color brighter​(java.awt.Color color)
      • brighter

        public static java.awt.Color brighter​(java.awt.Color color,
                                              double factor)
      • getHTMLColor

        public static java.lang.String getHTMLColor​(java.awt.Color c)
      • parseHTMLColor

        public static java.awt.Color parseHTMLColor​(java.lang.String c)
      • lum

        public static double lum​(java.awt.Color color)
      • toGray

        public static java.awt.Color toGray​(java.awt.Color color)
      • compatible

        public static boolean compatible​(java.awt.Color a,
                                         java.awt.Color b)
      • diff

        public static float diff​(java.awt.Color c1,
                                 java.awt.Color c2)
      • luminance

        public static float luminance​(java.awt.Color color)
      • brightness

        public static float brightness​(java.awt.Color color)
      • replaceBrightness

        public static java.awt.Color replaceBrightness​(java.awt.Color color,
                                                       double brightness)