Skip to main content
mrnb
February 18, 2022
Solved

Access/Change "Selection Colors" via Plugin API

  • February 18, 2022
  • 11 replies
  • 3248 views

Hi community,

i have a question regarding “selection colors”. Is it possible to access and change the colors of figma.currentPage.selection[0] in order to change all occasions of “color x” to “color y” with one change?

So I don’t need to access every single child element and change its color there.

Thanks in advance 🙂

This topic has been closed for replies.
Best answer by tank666

Now it’s possible.
figma.getSelectionColors()

figma.com – 21 Jun 23

11 replies

August 21, 2024

yeah but… that doesn’t fit the case. term selection is ambiguous here. see the use-case described by OP. the method you linked gives you the colors of user’s ACTUAL current selection only. selection as in… user clicked on it and it now has a border around.

i believe OP referred to Selection colors section on the right side-bar that tells one all the colors used within a group.

so… these… which… yea, i get it. it only shows up for the user selected clicked component…
image
would be nice to have a getter / setter for those for EACH component on a Figma page so that… if you rename your tokens you can iterate through all component’s selection colors and update them according to a migration spec.