What is the tail in SolidPaint's boundVariables.color.id

I am develop a plugin that can apply variable colors by some rule.
I found I need to assign the value like this:


I know that “e1b04111db373f08ec909607224cbaf0ff8aa032” is the variable’s id, but what is the “/2671:40” , and how do I acquire it?

I am using

const tokensCollection = libraryVariableCollections.find(collection => collection.name === "Tokens");
  if (tokensCollection) {
    const libraryVariables = await figma.teamLibrary.getVariablesInLibraryCollectionAsync(tokensCollection.key);

    const hoverlibraryVariable = libraryVariables.find(variable => variable.name.includes("Hover"));
    console.log(hoverlibraryVariable.key)
}

but it only get “e1b04111db373f08ec909607224cbaf0ff8aa032” part

This is the variable key, not the ID. The value of the variable ID should include everything that is shown in your screenshot, i.e. VariableID:e1b04111db373f08ec909607224cbaf0ff8aa032/2671:40.

This is the node ID assigned to the variable in the document.

Scheme:
VariableID:variableKey/nodeID — remote variable ID.
VariableID:nodeID — local variable ID.

As you can see, according to the scheme, your variable is remote, so to get its ID, you need to import it.

See a usage example here:

2 Likes