Get Insertion Point Color
✓ Published0🌍 Public
KKevinGutowski
Last edited Feb 17, 2019
Created on Feb 17, 2019
This example shows how to retrieve the color of the text insertion point caret within Sketch’s text-editing mode. It reads the currently selected text layer and, if the layer is actively being edited, logs the numeric caret color returned by the native `textView.insertionPointColor()` API. The snippet relies on Sketch’s CoreText framework, using `sketch/ui` to display a warning message when no editable text is selected and `sketch/dom` to access the selected layer’s editing delegate. The code is provided as a single JavaScript file, with no external dependencies or data source.
AI-generated description