This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Kai Oliver Reuter
Posted Jul 08 - Read on Facebook

Hi guys, i want to at different backgroundColors to a state. This doesn't seem to work? I hope you can help me. Thanks!

layerB.states.add({
stateA: {
backgroundColor: "#53585f"
},
stateB: {
backgroundColor: "#00d8cd"
}
});

5 Comments

Tisho Georgiev

For performance reasons, Framer doesn't animate colors. You can still change the background color by using the Events.StateDidChange event, but the change will be instant and I'm guessing this isn't what you want. To get around this limitation, you can try fading out a layer that has one of the colors and is positioned right on top of a layer that has the other color. This will make it seem like you're changing the color without actually having to animate the color change.

Kai Oliver Reuter

ok thanks for the info

Alex Aubert

Same for borderRadius?

Алексей Кольченко

Alex Aubert In states you can use properties which are animated (x, y, width, height, opacity, scale, rotation, filters). borderRadius could be changed via state change event.

Tom Haynes

I was trying to change the text contents (HTML) of a layer and tried to do it through states first. It might be worth adding the above to the documentation about states?

Read the entire post on Facebook