Class ColorMaps
- All Implemented Interfaces:
Serializable
Colors or Paints.- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionclosureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map) Returns a function which uses closure functions to determine which colors is returned for an input value.closureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map, io.deephaven.gui.color.Color outOfRangeColor) Returns a function which uses closure functions to determine which colors is returned for an input value.closureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) Returns a function which uses closure functions to determine which colors is returned for an input value.heatMap(double min, double max) Returns a heat map to map numerical values to colors.heatMap(double min, double max, io.deephaven.gui.color.Color startColor, io.deephaven.gui.color.Color endColor) Returns a heat map to map numerical values to colors.heatMap(double min, double max, io.deephaven.gui.color.Color startColor, io.deephaven.gui.color.Color endColor, io.deephaven.gui.color.Color nullColor) Returns a heat map to map numerical values to colors.predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map) Returns a function which uses predicate functions to determine which colors is returned for an input value.predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map, io.deephaven.gui.color.Color outOfRangeColor) Returns a function which uses predicate functions to determine which colors is returned for an input value.predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) Returns a function which uses predicate functions to determine which colors is returned for an input value.MapsRanges of values to specific colors.MapsRanges of values to specific colors.rangeMap(Map<Range, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) MapsRanges of values to specific colors.
-
Method Details
-
heatMap
Returns a heat map to map numerical values to colors.Values less than or equal to
minreturn the starting color. Values greater than or equal tomaxreturn the ending color. Values in between this range are a linear combination of the RGB components of these two colors. Higher values return colors that are closer to the ending color, and lower values return colors that are closer to the starting color.Inputs that are null or Double.NaN return a null color.
- Parameters:
min- minimummax- maximum- Returns:
- function for mapping double values to colors. The starting color is blue (#0000FF) and the ending color is yellow (#FFFF00).
-
heatMap
public static Function<Double,io.deephaven.gui.color.Color> heatMap(double min, double max, io.deephaven.gui.color.Color startColor, io.deephaven.gui.color.Color endColor) Returns a heat map to map numerical values to colors.Values less than or equal to
minreturn the starting color. Values greater than or equal tomaxreturn the ending color. Values in between this range are a linear combination of the RGB components of these two colors. Higher values return colors that are closer to the ending color, and lower values return colors that are closer to the starting color.Inputs that are null or Double.NaN return a null color.
- Parameters:
min- minimummax- maximumstartColor- color at values less than or equal tominendColor- color at values greater than or equal tomax- Returns:
- function for mapping double values to colors
-
heatMap
public static Function<Double,io.deephaven.gui.color.Color> heatMap(double min, double max, io.deephaven.gui.color.Color startColor, io.deephaven.gui.color.Color endColor, io.deephaven.gui.color.Color nullColor) Returns a heat map to map numerical values to colors.Values less than or equal to
minreturn the starting color. Values greater than or equal tomaxreturn the ending color. Values in between this range are a linear combination of the RGB components of these two colors. Higher values return colors that are closer to the ending color, and lower values return colors that are closer to the starting color.Inputs that are null or Double.NaN return a null color.
- Parameters:
min- minimummax- maximumstartColor- color at values less than or equal tominendColor- color at values greater than or equal tomaxnullColor- color at null input values- Returns:
- function for mapping double values to colors
-
rangeMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> rangeMap(Map<Range, COLOR> map) MapsRanges of values to specific colors. Values inside a givenRangereturn the correspondingPaint.Values not in any of the specified
Rangereturn an out of range color. Null inputs return a null color.- Type Parameters:
COLOR- type ofPaintin the map- Parameters:
map- map ofRanges toPaints.- Returns:
- function for mapping double values to colors. Null and out of range values return null.
-
rangeMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> rangeMap(Map<Range, COLOR> map, io.deephaven.gui.color.Color outOfRangeColor) MapsRanges of values to specific colors. Values inside a givenRangereturn the correspondingPaint.Values not in any of the specified
Rangereturn an out of range color. Null inputs return a null color.- Type Parameters:
COLOR- type ofPaintin the map- Parameters:
map- map ofRanges toPaints.outOfRangeColor- color for values not within any of the defined ranges- Returns:
- function for mapping double values to colors. Null values return null.
-
rangeMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> rangeMap(Map<Range, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) MapsRanges of values to specific colors. Values inside a givenRangereturn the correspondingPaint.Values not in any of the specified
Rangereturn an out of range color. Null inputs return a null color.- Type Parameters:
COLOR- type ofPaintin the map- Parameters:
map- map ofRanges toPaints.outOfRangeColor- color for values not within any of the defined rangesnullColor- color for null values- Returns:
- function for mapping double values to colors
-
predicateMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map) Returns a function which uses predicate functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the predicate function (map key) returns true. When the predicate returns true, the associated color (map value) is returned. If no such predicate is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromColorMaps.SerializablePredicateto color- Returns:
- function which returns the color mapped to the first
ColorMaps.SerializablePredicatefor which the input is true. Out of range, null, and NaN values return null.
-
predicateMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map, io.deephaven.gui.color.Color outOfRangeColor) Returns a function which uses predicate functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the predicate function (map key) returns true. When the predicate returns true, the associated color (map value) is returned. If no such predicate is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromColorMaps.SerializablePredicateto coloroutOfRangeColor- color returned when the input satisfies noColorMaps.SerializablePredicatein themap- Returns:
- function which returns the color mapped to the first
ColorMaps.SerializablePredicatefor which the input is true. Null and NaN inputs return null.
-
predicateMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> predicateMap(Map<ColorMaps.SerializablePredicate<Double>, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) Returns a function which uses predicate functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the predicate function (map key) returns true. When the predicate returns true, the associated color (map value) is returned. If no such predicate is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromColorMaps.SerializablePredicateto coloroutOfRangeColor- color returned when the input satisfies noColorMaps.SerializablePredicatein themapnullColor- color returned when the input is null or Double.NaN- Returns:
- function which returns the color mapped to the first
ColorMaps.SerializablePredicatefor which the input is true
-
closureMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> closureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map) Returns a function which uses closure functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the closure function (map key) returns true. When the closure returns true, the associated color (map value) is returned. If no such closure is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromClosureto color- Returns:
- function which returns the color mapped to the first
Closurefor which the input is true. Out of range, null, and NaN inputs return null.
-
closureMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> closureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map, io.deephaven.gui.color.Color outOfRangeColor) Returns a function which uses closure functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the closure function (map key) returns true. When the closure returns true, the associated color (map value) is returned. If no such closure is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromClosureto coloroutOfRangeColor- color returned when the input satisfies noClosurein themap- Returns:
- function which returns the color mapped to the first
Closurefor which the input is true. Null and NaN inputs return null.
-
closureMap
public static <COLOR extends io.deephaven.gui.color.Paint> Function<Double,io.deephaven.gui.color.Paint> closureMap(Map<groovy.lang.Closure<Boolean>, COLOR> map, io.deephaven.gui.color.Paint outOfRangeColor, io.deephaven.gui.color.Paint nullColor) Returns a function which uses closure functions to determine which colors is returned for an input value. For each input value, a map is iterated through until the closure function (map key) returns true. When the closure returns true, the associated color (map value) is returned. If no such closure is found, an out of range color is returned.- Type Parameters:
COLOR- type ofPaintinmap- Parameters:
map- map fromClosureto coloroutOfRangeColor- color returned when the input satisfies noClosurein themapnullColor- color returned when the input is null or Double.NaN- Returns:
- function which returns the color mapped to the first
Closurefor which the input is true
-