Class ColorUtil

java.lang.Object
com.intellij.util.ui.ColorUtil

public class ColorUtil extends Object
  • Method Details

    • softer

      public static Color softer(@NotNull Color color)
    • darker

      public static Color darker(@NotNull Color color, int tones)
    • brighter

      public static Color brighter(@NotNull Color color, int tones)
    • dimmer

      public static Color dimmer(@NotNull Color color)
    • shift

      public static Color shift(Color c, double d)
    • withAlpha

      public static Color withAlpha(Color c, double a)
    • toAlpha

      public static Color toAlpha(Color color, int a)
    • withAlphaAdjustingDarkness

      public static Color withAlphaAdjustingDarkness(Color c, double d)
    • toHex

      public static String toHex(@NotNull Color c)
    • fromHex

      public static Color fromHex(String str)
      Return Color object from string. The following formats are allowed: #abc123, ABC123, ab5, #FFF.
      Parameters:
      str - hex string
      Returns:
      Color object
    • fromHex

      @Nullable public static Color fromHex(String str, @Nullable Color defaultValue)
    • isDark

      public static boolean isDark(@NotNull Color c)
      Checks whether color is dark or not based on perceptional luminosity http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
      Parameters:
      c - color to check
      Returns:
      dark or not
    • mix

      @NotNull public static Color mix(@NotNull Color c1, @NotNull Color c2, double balance)