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

What is Framer? Join the Community
Return to index
Ash Adamson
Posted May 24 - Read on Facebook

Can you not do an "If" statement on string values for layer properties like backgroundColor?

If layer.backgroundColor == "FFFFFF"

Using this syntax yields no results


Andrew Nalband

It's because it's a color object

Fran Pérez

You can do:

Andrew Nalband

Ah, good call, Fran Pérez! Or sticking with the "if" sytax:

Jordan Robert Dobson

There are a few methods to get the and hex values from the object as well.

Koen Bok

Javascript does not allow you to "customize" comparisons like ==. So comparing objects is always by reference (is this the same object) and not by value (are these objects the same colors).

You can use the colorA.isEqual(colorB) method.

Read the entire post on Facebook