Package com.biglybt.ui.swt.mainwindow
Class Colors
- java.lang.Object
-
- com.biglybt.ui.swt.mainwindow.Colors
-
- All Implemented Interfaces:
ParameterListener
public class Colors extends java.lang.Object implements ParameterListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Colors.AllocateColor
Allocates a color
-
Field Summary
Fields Modifier and Type Field Description static org.eclipse.swt.graphics.Color[]
alternatingColors
static org.eclipse.swt.graphics.Color
background
static org.eclipse.swt.graphics.Color
black
static org.eclipse.swt.graphics.Color
blue
static org.eclipse.swt.graphics.Color[]
blues
static int
BLUES_DARKEST
static int
BLUES_LIGHTEST
static int
BLUES_MIDDARK
static int
BLUES_MIDLIGHT
private static AEMonitor
class_mon
static org.eclipse.swt.graphics.Color
colorAltRow
static org.eclipse.swt.graphics.Color
colorError
static org.eclipse.swt.graphics.Color
colorErrorBG
static org.eclipse.swt.graphics.Color
colorInverse
static org.eclipse.swt.graphics.Color
colorProgressBar
static org.eclipse.swt.graphics.Color
colorShiftLeft
static org.eclipse.swt.graphics.Color
colorShiftRight
static org.eclipse.swt.graphics.Color
colorWarning
private ParameterListener
configListener
static org.eclipse.swt.graphics.Color
cyan
static org.eclipse.swt.graphics.Color
dark_grey
static int
diffHue
static float
diffLumPct
static float
diffSatPct
private org.eclipse.swt.widgets.Display
display
static org.eclipse.swt.graphics.Color[]
faded
static int
FADED_DARKEST
static int
FADED_LIGHTEST
static org.eclipse.swt.graphics.Color
fadedBlue
static org.eclipse.swt.graphics.Color
fadedGreen
static org.eclipse.swt.graphics.Color
fadedRed
static org.eclipse.swt.graphics.Color
fadedYellow
private static AEDiagnosticsEvidenceGenerator
genColorCache
static org.eclipse.swt.graphics.Color
green
static org.eclipse.swt.graphics.Color
grey
private static Colors
instance
static org.eclipse.swt.graphics.Color
light_grey
(package private) static java.util.List<ParameterListener>
listeners
private static LogIDs
LOGID
static org.eclipse.swt.graphics.Color
maroon
static org.eclipse.swt.graphics.Color
red
static org.eclipse.swt.graphics.Color
red_ConsoleView
static org.eclipse.swt.graphics.Color
white
static org.eclipse.swt.graphics.Color
yellow
-
Constructor Summary
Constructors Modifier Constructor Description private
Colors()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColorsChangedListener(ParameterListener l)
private void
allocateBlues()
void
allocateColorAltRow()
private void
allocateColorError()
private void
allocateColorErrorBG()
private void
allocateColorProgressBar()
private void
allocateColorWarning()
private void
allocateDynamicColors(boolean first_time)
private void
allocateNonDynamicColors()
private void
dipose()
static void
disposeInstance()
org.eclipse.swt.graphics.RGB
getAlternativeRowColor(org.eclipse.swt.graphics.Color normal)
org.eclipse.swt.graphics.Color
getFadedColor(org.eclipse.swt.graphics.Color c)
static Colors
getInstance()
org.eclipse.swt.graphics.Color
getLighterColor(org.eclipse.swt.graphics.Color c, int percent)
org.eclipse.swt.graphics.Color
getReadableColor(org.eclipse.swt.graphics.Color forBG)
org.eclipse.swt.graphics.Color
getSlightlyFadedColor(org.eclipse.swt.graphics.Color c)
static org.eclipse.swt.graphics.Color
getSystemColor(org.eclipse.swt.graphics.Device d, int id)
static boolean
isBlackTextReadable(org.eclipse.swt.graphics.Color forBG)
static boolean
isColorContrastOk(org.eclipse.swt.graphics.Color color1, org.eclipse.swt.graphics.Color color2)
void
parameterChanged(java.lang.String parameterName)
Called, when a parameter has changed.void
removeColorsChangedListener(ParameterListener l)
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
instance
private static Colors instance
-
BLUES_LIGHTEST
public static final int BLUES_LIGHTEST
- See Also:
- Constant Field Values
-
BLUES_DARKEST
public static final int BLUES_DARKEST
- See Also:
- Constant Field Values
-
BLUES_MIDLIGHT
public static final int BLUES_MIDLIGHT
- See Also:
- Constant Field Values
-
BLUES_MIDDARK
public static final int BLUES_MIDDARK
- See Also:
- Constant Field Values
-
FADED_LIGHTEST
public static final int FADED_LIGHTEST
- See Also:
- Constant Field Values
-
FADED_DARKEST
public static final int FADED_DARKEST
- See Also:
- Constant Field Values
-
blues
public static org.eclipse.swt.graphics.Color[] blues
-
faded
public static org.eclipse.swt.graphics.Color[] faded
-
colorProgressBar
public static org.eclipse.swt.graphics.Color colorProgressBar
-
colorInverse
public static org.eclipse.swt.graphics.Color colorInverse
-
colorShiftLeft
public static org.eclipse.swt.graphics.Color colorShiftLeft
-
colorShiftRight
public static org.eclipse.swt.graphics.Color colorShiftRight
-
colorError
public static org.eclipse.swt.graphics.Color colorError
-
colorErrorBG
public static org.eclipse.swt.graphics.Color colorErrorBG
-
colorAltRow
public static org.eclipse.swt.graphics.Color colorAltRow
-
colorWarning
public static org.eclipse.swt.graphics.Color colorWarning
-
black
public static org.eclipse.swt.graphics.Color black
-
light_grey
public static org.eclipse.swt.graphics.Color light_grey
-
dark_grey
public static org.eclipse.swt.graphics.Color dark_grey
-
blue
public static org.eclipse.swt.graphics.Color blue
-
fadedBlue
public static org.eclipse.swt.graphics.Color fadedBlue
-
green
public static org.eclipse.swt.graphics.Color green
-
fadedGreen
public static org.eclipse.swt.graphics.Color fadedGreen
-
grey
public static org.eclipse.swt.graphics.Color grey
-
red
public static org.eclipse.swt.graphics.Color red
-
fadedRed
public static org.eclipse.swt.graphics.Color fadedRed
-
maroon
public static org.eclipse.swt.graphics.Color maroon
-
yellow
public static org.eclipse.swt.graphics.Color yellow
-
fadedYellow
public static org.eclipse.swt.graphics.Color fadedYellow
-
white
public static org.eclipse.swt.graphics.Color white
-
background
public static org.eclipse.swt.graphics.Color background
-
red_ConsoleView
public static org.eclipse.swt.graphics.Color red_ConsoleView
-
cyan
public static org.eclipse.swt.graphics.Color cyan
-
class_mon
private static final AEMonitor class_mon
-
diffHue
public static int diffHue
-
diffSatPct
public static float diffSatPct
-
diffLumPct
public static float diffLumPct
-
alternatingColors
public static final org.eclipse.swt.graphics.Color[] alternatingColors
-
listeners
static java.util.List<ParameterListener> listeners
-
genColorCache
private static AEDiagnosticsEvidenceGenerator genColorCache
-
configListener
private final ParameterListener configListener
-
display
private org.eclipse.swt.widgets.Display display
-
-
Method Detail
-
allocateBlues
private void allocateBlues()
-
allocateColorProgressBar
private void allocateColorProgressBar()
-
allocateColorErrorBG
private void allocateColorErrorBG()
-
allocateColorError
private void allocateColorError()
-
allocateColorWarning
private void allocateColorWarning()
-
getAlternativeRowColor
public org.eclipse.swt.graphics.RGB getAlternativeRowColor(org.eclipse.swt.graphics.Color normal)
-
allocateColorAltRow
public void allocateColorAltRow()
-
allocateDynamicColors
private void allocateDynamicColors(boolean first_time)
-
allocateNonDynamicColors
private void allocateNonDynamicColors()
-
getInstance
public static Colors getInstance()
-
disposeInstance
public static void disposeInstance()
-
dipose
private void dipose()
-
addColorsChangedListener
public void addColorsChangedListener(ParameterListener l)
-
removeColorsChangedListener
public void removeColorsChangedListener(ParameterListener l)
-
parameterChanged
public void parameterChanged(java.lang.String parameterName)
Description copied from interface:ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.- Specified by:
parameterChanged
in interfaceParameterListener
- Parameters:
parameterName
- the name of the parameter that has changed
-
getSystemColor
public static org.eclipse.swt.graphics.Color getSystemColor(org.eclipse.swt.graphics.Device d, int id)
-
getFadedColor
public org.eclipse.swt.graphics.Color getFadedColor(org.eclipse.swt.graphics.Color c)
-
getSlightlyFadedColor
public org.eclipse.swt.graphics.Color getSlightlyFadedColor(org.eclipse.swt.graphics.Color c)
-
getLighterColor
public org.eclipse.swt.graphics.Color getLighterColor(org.eclipse.swt.graphics.Color c, int percent)
-
isBlackTextReadable
public static boolean isBlackTextReadable(org.eclipse.swt.graphics.Color forBG)
-
getReadableColor
public org.eclipse.swt.graphics.Color getReadableColor(org.eclipse.swt.graphics.Color forBG)
-
isColorContrastOk
public static boolean isColorContrastOk(org.eclipse.swt.graphics.Color color1, org.eclipse.swt.graphics.Color color2)
-
-