Snapshot the full composition, both layers and colors, into a slot to reload anytime.
Randomized colors are drawn from within these windows, not the whole wheel.
Randomized density is drawn from within this window, so a randomize pass never drifts all the way to a solid fill (or, at the low end, an empty layer).
Layer B only shows in the gaps Layer A leaves empty. Lower either layer's density to let the background show through.