Class DBColorUtilImpl
- Direct Known Subclasses:
DBColorUtil
public class DBColorUtilImpl extends Object
DBColorUtil
field and Color
field conflicts are resolved.
TODO: This class won't be necessary once we can import DBColorUtil as static again.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DBColorUtilImpl.DistinctFormatter
Creates distinct and unique coloration for each unique input value. -
Field Summary
Fields Modifier and Type Field Description static long
COLOR_SET_BIT
static long
FOREGROUND_SET_BIT
static long
SELECTION_OVERRIDE_BIT
-
Constructor Summary
Constructors Constructor Description DBColorUtilImpl()
-
Method Summary
Modifier and Type Method Description static long
background(Color color)
Creates a table format encoding with specified background color and an unformatted foreground.static long
background(String color)
Creates a table format encoding with specified background color and an unformatted foreground.static long
backgroundForeground(Color bg, Color fg)
Creates a table format encoding with specified foreground and background colors.static long
backgroundForeground(String bg, String fg)
Creates a table format encoding with specified foreground and background colors.static long
backgroundForegroundAuto(Color color)
Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.static long
backgroundForegroundAuto(String color)
Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.static long
backgroundOverride(long color)
Background with Override ..static long
backgroundOverride(Color color)
Background with Override ..static long
backgroundOverride(String color)
Background with Override ..static long
bg(long color)
Convenience method forbackground(Color)
.static long
bg(long r, long g, long b)
Convenience method forbackground(Color)
.static long
bg(Color color)
Convenience method forbackground(Color)
.static long
bg(String color)
Convenience method forbackground(Color)
.static long
bgfg(long bg, long fg)
Convenience method forbackgroundForeground(Color, Color)
.static long
bgfg(long bgr, long bgg, long bgb, long fgr, long fgg, long fgb)
Convenience method forbackgroundForeground(Color, Color)
.static long
bgfg(Color bg, Color fg)
Convenience method forbackgroundForeground(Color, Color)
.static long
bgfg(String bg, String fg)
Convenience method forbackgroundForeground(Color, Color)
.static long
bgfga(long color)
Convenience method forbackgroundForegroundAuto(Color)
static long
bgfga(long bgr, long bgg, long bgb)
Convenience method forbackgroundForegroundAuto(Color)
static long
bgfga(Color color)
Convenience method forbackgroundForegroundAuto(Color)
static long
bgfga(String color)
Convenience method forbackgroundForegroundAuto(Color)
static long
bgo(long color)
Convenience method forbackgroundOverride(Color)
.static long
bgo(Color color)
Convenience method forbackgroundOverride(Color)
.static long
bgo(String color)
Convenience method forbackgroundOverride(Color)
.static long
fg(long color)
Convenience method forforeground(Color)
.static long
fg(long r, long g, long b)
Convenience method forforeground(Color)
.static long
fg(Color color)
Convenience method forforeground(Color)
.static long
fg(String color)
Convenience method forforeground(Color)
.static long
fgo(long color)
Convenience method forforegroundOverride(Color)
.static long
fgo(Color color)
Convenience method forforegroundOverride(Color)
.static long
fgo(String color)
Convenience method forforegroundOverride(Color)
.static long
foreground(Color color)
Creates a table format encoding with specified foreground color and unformatted background.static long
foreground(String color)
Creates a table format encoding with specified foreground color and unformatted background.static long
foregroundOverride(long color)
Foreground with Override ..static long
foregroundOverride(Color color)
Foreground with Override ..static long
foregroundOverride(String color)
Foreground with Override ..static long
heatmap(double value, double min, double max, long bg1, long bg2)
Creates a table format encoding for the heat map atvalue
.static long
heatmap(double value, double min, double max, Color bg1, Color bg2)
Creates a table format encoding for the heat map atvalue
.static long
heatmap(double value, double min, double max, String bg1, String bg2)
Creates a table format encoding for the heat map atvalue
.static long
heatmapFg(double value, double min, double max, long fg1, long fg2)
Convenience method forheatmapForeground(double, double, double, Color, Color)
static long
heatmapFg(double value, double min, double max, Color fg1, Color fg2)
static long
heatmapFg(double value, double min, double max, String fg1, String fg2)
static long
heatmapForeground(double value, double min, double max, Color fg1, Color fg2)
Creates a table format encoding for the heat map atvalue
with specified foreground color and unformatted background.static long
heatmapForeground(double value, double min, double max, String fg1, String fg2)
Creates a table format encoding for the heat map atvalue
with specified foreground color and unformatted background.static boolean
isBackgroundSelectionOverride(long color)
Checks if a background color should override selection.static boolean
isForegroundSelectionOverride(long color)
Checks if a foreground color should override selection.static long
toLong(long color)
Gets the formatting long of the input colorstatic long
toLong(Color color)
Gets the formatting long of the input colorstatic long
toLong(String color)
Gets the formatting long of the input colorstatic long
valueOf(String colorName)
Deprecated.
-
Field Details
-
COLOR_SET_BIT
public static final long COLOR_SET_BIT- See Also:
- Constant Field Values
-
SELECTION_OVERRIDE_BIT
public static final long SELECTION_OVERRIDE_BIT- See Also:
- Constant Field Values
-
FOREGROUND_SET_BIT
public static final long FOREGROUND_SET_BIT- See Also:
- Constant Field Values
-
-
Constructor Details
-
DBColorUtilImpl
public DBColorUtilImpl()
-
-
Method Details
-
background
Creates a table format encoding with specified background color and an unformatted foreground.- Parameters:
color
- color represented by aColor
- Returns:
- table format encoding with specified background color and unformatted foreground
-
background
Creates a table format encoding with specified background color and an unformatted foreground.- Parameters:
color
- the hex representation or the case-insensitive color name- Returns:
- table format encoding with specified background color and unformatted foreground
-
bg
public static long bg(long r, long g, long b)Convenience method forbackground(Color)
.This variant takes color RBG components as inputs.
-
bg
public static long bg(long color)Convenience method forbackground(Color)
.This variant takes the input color encoded as a long.
-
bg
Convenience method forbackground(Color)
.This variant takes the input color as a
Color
. -
bg
Convenience method forbackground(Color)
.This variant takes the input color as a
String
. This may be the hex representation or the case-insensitive color name. -
isBackgroundSelectionOverride
public static boolean isBackgroundSelectionOverride(long color)Checks if a background color should override selection.- Parameters:
color
- the color to check- Returns:
- true if the color should override selection, false otherwise
-
backgroundOverride
public static long backgroundOverride(long color)Background with Override .. Overrides the default selection color. -
backgroundOverride
Background with Override .. Overrides the default selection color. -
backgroundOverride
Background with Override .. Overrides the default selection color. -
bgo
public static long bgo(long color)Convenience method forbackgroundOverride(Color)
.This variant takes the input color encoded as a long.
-
bgo
Convenience method forbackgroundOverride(Color)
.This variant takes the input color as a
Color
. -
bgo
Convenience method forbackgroundOverride(Color)
.This variant takes the input color as a
String
. This may be the hex representation or the case-insensitive color name. -
foreground
Creates a table format encoding with specified foreground color and unformatted background.- Parameters:
color
- color represented by aColor
- Returns:
- table format encoding with specified foreground color and unformatted background
-
foreground
Creates a table format encoding with specified foreground color and unformatted background.- Parameters:
color
- the hex representation or the case-insensitive color name- Returns:
- table format encoding with specified foreground color and unformatted background
-
fg
public static long fg(long color)Convenience method forforeground(Color)
.This variant takes the input color encoded as a long. The resultant encoding is an unformatted background and a foreground the same color as the background color of the input, e.g. fg(bgfg(YELLOW, RED)) will result in a yellow foreground with no background formatting.
-
fg
Convenience method forforeground(Color)
.This variant takes the input color as a
Color
. -
fg
Convenience method forforeground(Color)
.This variant takes the input color as a
String
. This may be the hex representation or the case-insensitive color name. -
fg
public static long fg(long r, long g, long b)Convenience method forforeground(Color)
.This variant takes color RBG components as inputs.
-
isForegroundSelectionOverride
public static boolean isForegroundSelectionOverride(long color)Checks if a foreground color should override selection.- Parameters:
color
- the color to check- Returns:
- true if the color should override selection, false otherwise
-
foregroundOverride
public static long foregroundOverride(long color)Foreground with Override .. Overrides the default selection color. -
foregroundOverride
Foreground with Override .. Overrides the default selection color. -
foregroundOverride
Foreground with Override .. Overrides the default selection color. -
fgo
public static long fgo(long color)Convenience method forforegroundOverride(Color)
.This variant takes the input color encoded as a long.
-
fgo
Convenience method forforegroundOverride(Color)
.This variant takes the input color as a
Color
. -
fgo
Convenience method forforegroundOverride(Color)
.This variant takes the input color as a
String
. This may be the hex representation or the case-insensitive color name. -
backgroundForeground
Creates a table format encoding with specified foreground and background colors. -
backgroundForeground
Creates a table format encoding with specified foreground and background colors.- Parameters:
bg
- background color represented by aString
. This may be the hex representation or the case-insensitive color namefg
- foreground color represented by aString
. This may be the hex representation or the case-insensitive color name- Returns:
- table format encoding with specified foreground and background colors
-
bgfg
public static long bgfg(long bgr, long bgg, long bgb, long fgr, long fgg, long fgb)Convenience method forbackgroundForeground(Color, Color)
.This variant takes color RBG components as inputs.
-
bgfg
public static long bgfg(long bg, long fg)Convenience method forbackgroundForeground(Color, Color)
.This variant takes colors encoded as longs for inputs.
-
bgfg
Convenience method forbackgroundForeground(Color, Color)
.This variant takes the input colors as
Color
s. -
bgfg
Convenience method forbackgroundForeground(Color, Color)
.This variant takes the input colors as
String
s. This may be the hex representation or the case-insensitive color name. -
backgroundForegroundAuto
Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.- Parameters:
color
- background color represented by aColor
- Returns:
- table format encoding with background color and auto-generated foreground color
-
backgroundForegroundAuto
Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.- Parameters:
color
- background color represented by aString
. This may be the hex representation or the case-insensitive color name- Returns:
- table format encoding with background color and auto-generated foreground color
-
bgfga
public static long bgfga(long bgr, long bgg, long bgb)Convenience method forbackgroundForegroundAuto(Color)
This variant takes color RBG components as inputs.
-
bgfga
public static long bgfga(long color)Convenience method forbackgroundForegroundAuto(Color)
This variant takes the input color encoded as a long.
-
bgfga
Convenience method forbackgroundForegroundAuto(Color)
This variant takes the input color as a
Color
. -
bgfga
Convenience method forbackgroundForegroundAuto(Color)
This variant takes the input color as a
String
. This may be the hex representation or the case-insensitive color name. -
heatmap
public static long heatmap(double value, double min, double max, long bg1, long bg2)Creates a table format encoding for the heat map atvalue
. A contrasting foreground color is automatically chosen.- Parameters:
value
- determines the color used by its location in the heat map's rangemin
- minimum value of the heat map rangemax
- maximum value of the heat map rangebg1
- background color at or below the minimum value of the heat map. Encoded as a longbg2
- background color at or above the maximum value of the heat map. Encoded as a long- Returns:
- table format encoding with background color and auto-generated foreground color determined by a heat map
-
heatmap
Creates a table format encoding for the heat map atvalue
. A contrasting foreground color is automatically chosen.- Parameters:
value
- determines the color used by its location in the heat map's rangemin
- minimum value of the heat map rangemax
- maximum value of the heat map rangebg1
- background color at or below the minimum value of the heat map.bg2
- background color at or above the maximum value of the heat map.- Returns:
- table format encoding with background color and auto-generated foreground color determined by a heat map
-
heatmap
Creates a table format encoding for the heat map atvalue
. A contrasting foreground color is automatically chosen.- Parameters:
value
- determines the color used by its location in the heat map's rangemin
- minimum value of the heat map rangemax
- maximum value of the heat map rangebg1
- background color at or below the minimum value of the heat map.bg2
- background color at or above the maximum value of the heat map.- Returns:
- table format encoding with background color and auto-generated foreground color determined by a heat map
-
heatmapForeground
Creates a table format encoding for the heat map atvalue
with specified foreground color and unformatted background.- Parameters:
value
- determines the color used by its location in the heat map's rangemin
- minimum value of the heat map range.max
- maximum value of the heat map range.fg1
- foreground color at or below the minimum value of the heat mapfg2
- foreground color at or above the maximum value of the heat map- Returns:
- table format encoding with foreground color determined by a heat map
-
heatmapForeground
Creates a table format encoding for the heat map atvalue
with specified foreground color and unformatted background.- Parameters:
value
- determines the color used by its location in the heat map's rangemin
- minimum value of the heat map range.max
- maximum value of the heat map range.fg1
- foreground color at or below the minimum value of the heat mapfg2
- foreground color at or above the maximum value of the heat map- Returns:
- table format encoding with foreground color determined by a heat map
-
heatmapFg
public static long heatmapFg(double value, double min, double max, long fg1, long fg2)Convenience method forheatmapForeground(double, double, double, Color, Color)
This variant takes the input colors encoded as a longs. These colors must be formatted as a foreground (i.e. through fg() call) for this to work as expected.
-
heatmapFg
SeeheatmapFg(double, double, double, long, long)
This variant takes the input colors as
Color
s. -
heatmapFg
SeeheatmapFg(double, double, double, long, long)
This variant takes the input colors as
String
s. This may be the hex representation or the case-insensitive color name. -
toLong
public static long toLong(long color)Gets the formatting long of the input color- Parameters:
color
- color encoded in a long- Returns:
- formatting long of the input color
-
toLong
Gets the formatting long of the input color- Parameters:
color
- color represented by aColor
- Returns:
- formatting long of the input color
-
toLong
Gets the formatting long of the input color- Parameters:
color
- the hex representation or the case-insensitive color name- Returns:
- formatting long of the input color
- Throws:
IllegalArgumentException
- Ifcolor
is invalid
-
valueOf
Deprecated.Returns thelong
value for the color with the given name. For example,DBColorUtil.valueOf("VIVID_BLUE") == Color.VIVID_BLUE
.This method has been deprecated. The new method is
toLong(String)
- Parameters:
colorName
- The name of the color to retrieve.- Returns:
- The
long
value for the given color - Throws:
IllegalArgumentException
- IfcolorName
is invalid
-