Skip to content

Commit 40125ce

Browse files
D-R-Smithjenmerritt
authored andcommitted
Fix colormap to use Color (#735)
1 parent 2c4f0df commit 40125ce

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

raster/colormap-renderer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pan and zoom to explore the effect of the colormap applied to the raster.
1616

1717
1. Create a `Raster` from a raster file.
1818
2. Create a `RasterLayer` from the raster.
19-
3. Create a `List<Integer>` representing colors. Colors at the beginning of the list replace the darkest values in the raster and colors at the end of the list replaced the brightest values of the raster.
19+
3. Create a `List<Color>` representing colors. Colors at the beginning of the list replace the darkest values in the raster and colors at the end of the list replaced the brightest values of the raster.
2020
4. Create a `ColormapRenderer` with the color list: `ColormapRenderer(colors)`, and apply it to the raster layer with `rasterLayer.setRasterRenderer(colormapRenderer)`.
2121

2222
## Relevant API

raster/colormap-renderer/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
group = 'com.esri.samples'
77

88
ext {
9-
arcgisVersion = '100.15.0'
9+
arcgisVersion = '200.0.0-3666'
1010
}
1111

1212
javafx {

raster/colormap-renderer/src/main/java/com/esri/samples/colormap_renderer/ColormapRendererSample.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import javafx.scene.Scene;
2626
import javafx.scene.control.Alert;
2727
import javafx.scene.layout.StackPane;
28+
import javafx.scene.paint.Color;
2829
import javafx.stage.Stage;
2930

3031
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
@@ -75,10 +76,10 @@ public void start(Stage stage) {
7576
// add the raster to the map's operational layers
7677
map.getOperationalLayers().add(rasterLayer);
7778

78-
// create a color map where values 0-149 are red (0xFFFF0000) and 150-250 are yellow (0xFFFFFF00)
79-
List<Integer> colors = IntStream.range(0, 250)
79+
// create a color map where values 0-149 are red and 150-250 are yellow
80+
List<Color> colors = IntStream.range(0, 250)
8081
.boxed()
81-
.map(i -> i < 150 ? 0xFFFF0000 : 0xFFFFFF00)
82+
.map(i -> i < 150 ? Color.RED : Color.YELLOW)
8283
.collect(Collectors.toList());
8384

8485
// create a colormap renderer

0 commit comments

Comments
 (0)