Package ghidra.util
Class ColorUtils
java.lang.Object
ghidra.util.ColorUtils
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
static final float
static final float
static final float
static final float
static final float
static final float
static final float
static final float
static final float
static final float
static final float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Color
Takes the first color, blending into it the second color, using the given ratio.static Color
contrastForegroundColor
(Color color) A method to produce a color (either black or white) that contrasts with the given color.static Color
deriveBackground
(Color background, float hue) static Color
deriveBackground
(Color src, float hue, float sfact, float bfact) static Color
deriveForeground
(Color bg, float hue) static Color
deriveForeground
(Color bg, float hue, float brt)
-
Field Details
-
HUE_RED
public static final float HUE_RED- See Also:
-
HUE_ORANGE
public static final float HUE_ORANGE- See Also:
-
HUE_YELLOW
public static final float HUE_YELLOW- See Also:
-
HUE_LIME
public static final float HUE_LIME- See Also:
-
HUE_GREEN
public static final float HUE_GREEN- See Also:
-
HUE_PINE
public static final float HUE_PINE- See Also:
-
HUE_TURQUISE
public static final float HUE_TURQUISE- See Also:
-
HUE_SAPPHIRE
public static final float HUE_SAPPHIRE- See Also:
-
HUE_BLUE
public static final float HUE_BLUE- See Also:
-
HUE_ROYAL
public static final float HUE_ROYAL- See Also:
-
HUE_PURPLE
public static final float HUE_PURPLE- See Also:
-
HUE_PINK
public static final float HUE_PINK- See Also:
-
-
Constructor Details
-
ColorUtils
public ColorUtils()
-
-
Method Details
-
deriveBackground
-
deriveBackground
-
deriveForeground
-
deriveForeground
-
contrastForegroundColor
A method to produce a color (either black or white) that contrasts with the given color. This is useful for finding a readable foreground color for a given background.- Parameters:
color
- the color for which to find a contrast.- Returns:
- the contrasting color.
-
blend
Takes the first color, blending into it the second color, using the given ratio. A lower ratio (say .1f) signals to use very little of the first color; a larger ratio signals to use more of the first color.- Parameters:
c1
- the first colorc2
- the second colorratio
- the amount of the first color to include in the final output- Returns:
- the new color
-