Does the Adobe XD API provide a way to get the color at a specific point (x, y)?
Not directly. I can think of two partial solutions:
- Inspect the “fill” color property of the GraphicNode at a certain point. That would only be useful for solid fills, not gradients. And it would be significant work to map from a point on the canvas to a specific node.
- Use application.createRenditions() to export an artboard as a PNG file in the plugin’s temp folder. Then examine that PNG for a color value at a point. This example illustrates how to create and read renditions: https://github.com/AdobeXD/plugin-samples/tree/master/ui-panel-show-renditions