Class DBColorUtilImpl
- Direct Known Subclasses:
DBColorUtil
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 ClassesModifier and TypeClassDescriptionstatic classCreates distinct and unique coloration for each unique input value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longbackground(Color color) Creates a table format encoding with specified background color and an unformatted foreground.static longbackground(String color) Creates a table format encoding with specified background color and an unformatted foreground.static longbackgroundForeground(Color bg, Color fg) Creates a table format encoding with specified foreground and background colors.static longbackgroundForeground(String bg, String fg) Creates a table format encoding with specified foreground and background colors.static longbackgroundForegroundAuto(Color color) Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.static longbackgroundForegroundAuto(String color) Creates a table format encoding with specified background color and automatically chosen contrasting foreground color.static longbackgroundOverride(long color) Background with Override ..static longbackgroundOverride(Color color) Background with Override ..static longbackgroundOverride(String color) Background with Override ..static longbg(long color) Convenience method forbackground(Color).static longbg(long r, long g, long b) Convenience method forbackground(Color).static longConvenience method forbackground(Color).static longConvenience method forbackground(Color).static longbgfg(long bg, long fg) Convenience method forbackgroundForeground(Color, Color).static longbgfg(long bgr, long bgg, long bgb, long fgr, long fgg, long fgb) Convenience method forbackgroundForeground(Color, Color).static longConvenience method forbackgroundForeground(Color, Color).static longConvenience method forbackgroundForeground(Color, Color).static longbgfga(long color) Convenience method forbackgroundForegroundAuto(Color)static longbgfga(long bgr, long bgg, long bgb) Convenience method forbackgroundForegroundAuto(Color)static longConvenience method forbackgroundForegroundAuto(Color)static longConvenience method forbackgroundForegroundAuto(Color)static longbgo(long color) Convenience method forbackgroundOverride(Color).static longConvenience method forbackgroundOverride(Color).static longConvenience method forbackgroundOverride(Color).static longfg(long color) Convenience method forforeground(Color).static longfg(long r, long g, long b) Convenience method forforeground(Color).static longConvenience method forforeground(Color).static longConvenience method forforeground(Color).static longfgo(long color) Convenience method forforegroundOverride(Color).static longConvenience method forforegroundOverride(Color).static longConvenience method forforegroundOverride(Color).static longforeground(Color color) Creates a table format encoding with specified foreground color and unformatted background.static longforeground(String color) Creates a table format encoding with specified foreground color and unformatted background.static longforegroundOverride(long color) Foreground with Override ..static longforegroundOverride(Color color) Foreground with Override ..static longforegroundOverride(String color) Foreground with Override ..static longheatmap(double value, double min, double max, long bg1, long bg2) Creates a table format encoding for the heat map atvalue.static longCreates a table format encoding for the heat map atvalue.static longCreates a table format encoding for the heat map atvalue.static longheatmapFg(double value, double min, double max, long fg1, long fg2) Convenience method forheatmapForeground(double, double, double, Color, Color)static longstatic longstatic longheatmapForeground(double value, double min, double max, Color fg1, Color fg2) Creates a table format encoding for the heat map atvaluewith specified foreground color and unformatted background.static longheatmapForeground(double value, double min, double max, String fg1, String fg2) Creates a table format encoding for the heat map atvaluewith specified foreground color and unformatted background.static booleanisBackgroundSelectionOverride(long color) Checks if a background color should override selection.static booleanisForegroundSelectionOverride(long color) Checks if a foreground color should override selection.static longtoLong(long color) Gets the formatting long of the input colorstatic longGets the formatting long of the input colorstatic longGets the formatting long of the input colorstatic longDeprecated.
-
Field Details
-
COLOR_SET_BIT
public static final long COLOR_SET_BIT- See Also:
-
SELECTION_OVERRIDE_BIT
public static final long SELECTION_OVERRIDE_BIT- See Also:
-
FOREGROUND_SET_BIT
public static final long FOREGROUND_SET_BIT- See Also:
-
-
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
Colors. -
bgfg
Convenience method forbackgroundForeground(Color, Color).This variant takes the input colors as
Strings. 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 atvaluewith 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 atvaluewith 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
Colors. -
heatmapFg
SeeheatmapFg(double, double, double, long, long)This variant takes the input colors as
Strings. 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- Ifcoloris invalid
-
valueOf
Deprecated.Returns thelongvalue 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
longvalue for the given color - Throws:
IllegalArgumentException- IfcolorNameis invalid
-