How to get the color at a point?

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:

  1. 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.
  2. 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: