Spectrum for Adobe XD plugin

I’m not able to install this plugin for some reason (I’m still figuring it out) but is it possible to get the visual settings of the spectrum components?

For example, if a user puts a Spectrum Button component on the artboard and changes the fill color can my plugin get:

  1. That it is a Spectrum component (created by the Spectrum plugin)
  2. The fill color that has been changed from default

I’m not sure why you can’t download it yet…

When XD 36 comes out in January, there will be Spectrum support, I’m working with the team on a blog post and newsletter update even as I write this. For now, you can read the Spectrum Web Component documentation here.

1 Like

I was able to install it. Now I need to know if it’s possible to get the user preferences from the Spectrum components.

For example, if a user using the Spectrum plugin (shown above) puts a Spectrum Button component on the artboard and changes the fill color (using the Spectrum plugin shown above) can my plugin get:

  1. That it is a Spectrum component (created by the Spectrum plugin)
  2. The fill color that has been changed from the default

I’ve noticed there is a new sharedPluginData property on SceneNode objects. Is any data written to this by the Spectrum plugin (shown above) about the scene nodes property changes?

If you were to look at the code it would look something like this:

const ADOBE_SPECTRUM_PLUGIN_ID = "<ID here>";
var sharedData = sceneNode.sharedPluginData.getForPluginId(ADOBE_SPECTRUM_PLUGIN_ID);
var numberOfKeys = sharedData.keys();

if (numberOfKeys>0) {
    // guessing the names of the properties
    if (sharedData.getKey("fill")!=null) {
        // do something
    }
    if (sharedData.getKey("textColor")!=null) {
       // do something
     }
    if (sharedData.getKey("label")!=null) {
      // do something
    }
 }