Class GradientColorMapGenerator
Object
GradientColorMapGenerator
A class mainly used to parse an SVG file and create a ColorMap on top of the LinearGradientEntry contained on it, or
create a ColorMap on top of a ";" separated values list of colors such as: rgb(0,0,255);rgb(0,255,0);rgb(255,0,0);...
or #0000FF;#00FF00;#FF0000 as an instance. *
- Author:
- Daniele Romagnoli, GeoSolutions SAS
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongenerateColorMap
(double min, double max) Generate aColorMap
object, by updating the ColorMapEntries quantities on top of the min and max values reported here.static GradientColorMapGenerator
getColorMapGenerator
(File file) Get an SVG ColorMap generator for the specified filestatic GradientColorMapGenerator
getColorMapGenerator
(String colorValues) Get an SVG ColorMap generator for the specified filestatic Color
Convert an hex color representation to aColor
void
setAfterColor
(Color color) Sets the color to be used after the max value.void
setAfterColor
(String color) Sets the color to be used after the max value, as a string, it accepts the same syntax asgetColorMapGenerator(String)
void
setBeforeColor
(Color color) Sets the color to be used before the min value.void
setBeforeColor
(String color) Sets the color to be used before the min value, as a string, it accepts the same syntax asgetColorMapGenerator(String)
-
Field Details
-
RGB_INLINEVALUE_MARKER
- See Also:
-
RGBA_INLINEVALUE_MARKER
- See Also:
-
HEX_INLINEVALUE_MARKER
- See Also:
-
HEX2_INLINEVALUE_MARKER
- See Also:
-
-
Method Details
-
setBeforeColor
Sets the color to be used before the min value. By default it's transparent -
setBeforeColor
Sets the color to be used before the min value, as a string, it accepts the same syntax asgetColorMapGenerator(String)
-
setAfterColor
Sets the color to be used after the max value. By default it's transparent -
setAfterColor
Sets the color to be used after the max value, as a string, it accepts the same syntax asgetColorMapGenerator(String)
-
generateColorMap
Generate aColorMap
object, by updating the ColorMapEntries quantities on top of the min and max values reported here. -
getColorMapGenerator
public static GradientColorMapGenerator getColorMapGenerator(File file) throws SAXException, IOException, ParserConfigurationException Get an SVG ColorMap generator for the specified file -
getColorMapGenerator
public static GradientColorMapGenerator getColorMapGenerator(String colorValues) throws IOException, ParserConfigurationException Get an SVG ColorMap generator for the specified file- Parameters:
colorValues
- ";" separated list of colors in the form c1;c2;c3;... where each color can use syntaxes as rgb(r0,g0,b0), rgba(r0,g0,b0,alpha_0_to_1), #RRGGBB or 0xRRGGBB- Throws:
IOException
ParserConfigurationException
-
hex2Rgb
Convert an hex color representation to aColor
- Returns:
- the
Color
instance related to that color HEX string
-