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.

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:

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.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close