Package ghidra.util
Class ColorUtils
- java.lang.Object
- 
- ghidra.util.ColorUtils
 
- 
 public class ColorUtils extends java.lang.Object
- 
- 
Field SummaryFields Modifier and Type Field Description static floatHUE_BLUEstatic floatHUE_GREENstatic floatHUE_LIMEstatic floatHUE_ORANGEstatic floatHUE_PINEstatic floatHUE_PINKstatic floatHUE_PURPLEstatic floatHUE_REDstatic floatHUE_ROYALstatic floatHUE_SAPPHIREstatic floatHUE_TURQUISEstatic floatHUE_YELLOW
 - 
Constructor SummaryConstructors Constructor Description ColorUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Colorblend(java.awt.Color c1, java.awt.Color c2, float ratio)Takes the first color, blending into it the second color, using the given ratio.static java.awt.ColorcontrastForegroundColor(java.awt.Color color)A method to produce a color (either black or white) that contrasts with the given color.static java.awt.ColorderiveBackground(java.awt.Color background, float hue)static java.awt.ColorderiveBackground(java.awt.Color src, float hue, float sfact, float bfact)static java.awt.ColorderiveForeground(java.awt.Color bg, float hue)static java.awt.ColorderiveForeground(java.awt.Color bg, float hue, float brt)
 
- 
- 
- 
Field Detail- 
HUE_REDpublic static final float HUE_RED - See Also:
- Constant Field Values
 
 - 
HUE_ORANGEpublic static final float HUE_ORANGE - See Also:
- Constant Field Values
 
 - 
HUE_YELLOWpublic static final float HUE_YELLOW - See Also:
- Constant Field Values
 
 - 
HUE_LIMEpublic static final float HUE_LIME - See Also:
- Constant Field Values
 
 - 
HUE_GREENpublic static final float HUE_GREEN - See Also:
- Constant Field Values
 
 - 
HUE_PINEpublic static final float HUE_PINE - See Also:
- Constant Field Values
 
 - 
HUE_TURQUISEpublic static final float HUE_TURQUISE - See Also:
- Constant Field Values
 
 - 
HUE_SAPPHIREpublic static final float HUE_SAPPHIRE - See Also:
- Constant Field Values
 
 - 
HUE_BLUEpublic static final float HUE_BLUE - See Also:
- Constant Field Values
 
 - 
HUE_ROYALpublic static final float HUE_ROYAL - See Also:
- Constant Field Values
 
 - 
HUE_PURPLEpublic static final float HUE_PURPLE - See Also:
- Constant Field Values
 
 - 
HUE_PINKpublic static final float HUE_PINK - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
deriveBackgroundpublic static java.awt.Color deriveBackground(java.awt.Color src, float hue, float sfact, float bfact)
 - 
deriveBackgroundpublic static java.awt.Color deriveBackground(java.awt.Color background, float hue)
 - 
deriveForegroundpublic static java.awt.Color deriveForeground(java.awt.Color bg, float hue, float brt)
 - 
deriveForegroundpublic static java.awt.Color deriveForeground(java.awt.Color bg, float hue)
 - 
contrastForegroundColorpublic static java.awt.Color contrastForegroundColor(java.awt.Color color) 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.
 
 - 
blendpublic static java.awt.Color blend(java.awt.Color c1, java.awt.Color c2, float ratio)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 color
- c2- the second color
- ratio- the amount of the first color to include in the final output
- Returns:
- the new color
 
 
- 
 
-