Class ColorUtil

java.lang.Object
com.github.weisj.darklaf.color.ColorUtil

public final class ColorUtil extends Object
  • Constructor Details

    • ColorUtil

      public ColorUtil()
  • Method Details

    • 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, Color defaultValue)
    • fromHex

      public static Color fromHex(String str, Color defaultValue, boolean fullSizeHex)
    • toHex

      public static String toHex(Color color)
    • 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)