Figma Support Forum

Editing color styles with a plugin: Figma API problem

Hey! We are creating a plugin to help us edit styles in the design system and keep our tokens in order. The development team ran into an issue we found in the Figma documentation. Unfortunately, Figma’s documentation states that we cannot edit color styles with the plugin. But for example, we can easily edit font styles.
Tell me, can we give the right to edit via Figma API specifically for our organization? This is a critical feature for us to help develop and maintain design styles.
If so, tell me the approximate terms of implementation of such access, and is it possible?

Thanks a lot!


In read-only, properties can be overwritten. For example:

figma.getStyleById('S:styleId,').paints = [
	{
		type: "SOLID",
		visible: true,
		opacity: 1,
		blendMode: "NORMAL",
		color: {
			r: 0.4, g: 0, b: 0
		}
	}
]

You can learn more at Figma Developers:

Is it possible to edit the style colors and not in the layout?

I need to edit style colors with the plugin.

If I understood the documentation correctly, it only allows editing hex values, but not the style in Figma. I need to be able to edit just the styles but not the elements in the design

@Daniela_Muntyan, the example code above changes the style properties, not the layout.

Thank you! It works :raised_hands: