First of all, I know that you can just render a transparent background and then composite anything you want behind it, but it will not work inside the 3D viewport, and I like having a fairly neutral background color when I’m working on textures.
This is a really simple node setup that separates the visible background color, from the background color that is used for lighting your scene.
You just… plug this in place of the normal background node.
What is really nice about using a node group here, is that the node group inputs become directly accessible from the UI, without having to enter the node editor again.
And that’s really all there is to it really, there is probably some room for improvement and I don’t know what happens if you are rendering translucent objects, but I’ve done a few side by side comparisons and did not notice any difference. I just use this to get my viewport the same color in “Rendered” as it is in the other shading modes.