Create two instances for that pattern. And in script enable one, disable one based on the shape color palette.