I have two polygon layers. Layer 1 is the coverage layer for an atlas. I would like the color of labels for layer 2 to change based on whether or not the feature overlaps with the current atlas controlling feature in layer 1. Here is what I've tried as the expression controlling label color in layer 2:
case when intersects_bbox($geometry, atlas_geometry) then color_rgb(0,0,0) else color_rgb(255,255,255) end
But all the labels are black no matter what I try. What am I doing wrong? (and is there a better way to do this?