Class ColorUtil


  • public final class ColorUtil
    extends Object
    • Constructor Detail

      • ColorUtil

        public ColorUtil()
    • Method Detail

      • blendColors

        public static Color blendColors​(Color color1,
                                        Color color2,
                                        double percent)
      • shift

        public static Color shift​(Color c,
                                  double d)
      • toAlpha

        public static Color toAlpha​(Color color,
                                    double alpha)
      • toAlpha

        public static Color toAlpha​(Color color,
                                    int a)
      • fromHex

        public static Color fromHex​(String str)
      • canOverwriteColor

        public static boolean canOverwriteColor​(Color c)
      • stripUIResource

        public static Color stripUIResource​(Color c,
                                            boolean canOverwrite)
      • removeAlpha

        public static Color removeAlpha​(Color color)
      • getPerceivedBrightness

        public static double getPerceivedBrightness​(Color c)
        Calculate the perceived brightness of a color.
        Parameters:
        c - the color.
        Returns:
        the brightness from 0 to 255.
      • getLuminance

        public static double getLuminance​(Color c)
      • getLuminance

        public static double getLuminance​(int red,
                                          int green,
                                          int blue)