Changing variable mode for layer

I’m working on a Figma plugin to create color swatches dynamically based on local variable collections. The generated color swatches would be binded with the variables.
While I’ve managed to generate seperate frame for swatches of the both modes (Mode 0 ) (Mode 1 ).

The issue is for Mode 1 Frame I’ve to change variable mode because by default it’s set to Auto (which is Mode 0).
So is there any way to change variable mode for a layer in Figma API?

Screenshot 2023-08-21 060115

Any guidance or insights on how to achieve this would be greatly appreciated!

1 Like
node.setExplicitVariableModeForCollection(collectionId, modeId)
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.