Package com.github.weisj.darklaf.util
Class ColorUtil
- java.lang.Object
-
- com.github.weisj.darklaf.util.ColorUtil
-
public final class ColorUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColorUtil.NonUIResourceColorWrapperstatic classColorUtil.NonUIResourceOverwritableColorWrapper
-
Constructor Summary
Constructors Constructor Description ColorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ColorblendColors(Color color1, Color color2, double percent)static booleancanOverwriteColor(Color c)static ColorfromHex(String str)static ColorfromHex(String str, Color defaultValue)static doublegetLuminance(int red, int green, int blue)static doublegetLuminance(Color c)static doublegetPerceivedBrightness(Color c)Calculate the perceived brightness of a color.static ColorremoveAlpha(Color color)static Colorshift(Color c, double d)static ColorstripUIResource(Color c, boolean canOverwrite)static ColortoAlpha(Color color, double alpha)static ColortoAlpha(Color color, int a)static StringtoHex(Color color)
-
-
-
Method Detail
-
canOverwriteColor
public static boolean canOverwriteColor(Color c)
-
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)
-
-