Color theming for interactive tools

This sample shows how to use the Theme class on SceneView.theme to customize the colors of the temporary graphics and labels of interactive tools, such as the DirectLineMeasurement3D. Theme can be applied to both SceneView and MapView.

By default, this app uses a green theme, but it can dynamically be changed to pink.

Use dark colors for code blocksCopy
1
2
3
4
5
// Update the theme to use slightly transparent green graphics and green text
view.theme = {
  accentColor: [55, 200, 100, 0.75],
  textColor: "green"
};

Additionally, this app exemplifies how to use the same colors on the buttons of the UI:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Customize the buttons' colors */
.theme-green,
.theme-green .esri-ui {
  --calcite-color-brand: rgb(55, 200, 100);
  --calcite-color-brand-hover: rgb(0, 150, 50);
  --calcite-color-brand-press: rgb(0, 100, 0);
}
.theme-pink,
.theme-pink .esri-ui {
  --calcite-color-brand: rgb(255, 0, 155);
  --calcite-color-brand-hover: rgb(200, 0, 100);
  --calcite-color-brand-press: rgb(150, 0, 50);
}
color-theming

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.