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.
You can’t access all colors directly like this: selection colors is a high-level feature while the API exposes mostly low-level building blocks which you can use to customize anything pretty much. I don’t see a problem in iterating over all children using something like figma.currentPage.selection[0].findAll and writing a couple of conditions inside of it.
Yeah, if you need only certain types of nodes, if you had access to selection colors this wouldn’t have helped anyway, since selection colors show colors from all objects within selection.
Oh, I thought you wanted only specific types of nodes judging by this part: child.type === ‘INSTANCE’ || child.type === ‘TEXT’|| … — you don’t need it if you want all nodes.
but I want all nodes, where I can check for an strokStyleId and fillStyleId to change them. And based on the typescript errors I get, I need to check for certain types of nodes. Don’t I?