Skip to main content
100%

Highlight a layer

✓ Published0🌍 Public
KKevinGutowski
Last edited Mar 8, 2020
Created on Mar 8, 2020

This example demonstrates how to visually isolate a single layer within a Sketch document by highlighting it. The code uses the Sketch JavaScript API, specifically `sketch.getSelectedDocument()` and `document.selectedPage.layers[0].layers[0]`, to access a target layer. It then triggers the highlight by calling `normalEventHandler.setHighlightedItem(layer.sketchObject)` on the document’s event handler manager. The visualization relies on Sketch’s built-in interface to render the highlighted state, with no external data source or custom rendering logic involved.

AI-generated description

Similar vizzes