However this only works for the Surface and Post Processing domains. The User interface domain doesn’t have access to scene color or scene texture nodes. If you can find a way to sample the scene color and provide it to a UI domain material, something like this may work or point you in the right direction.
Though you may be able to do it with post processing