Viewport color the same as render view

Hi, I see this may have been asked a few times but the viewport color is not the same as when I use an hdri in the render view. What is the equation and is it possible to translate the render color so that it will match the viewport color. Not by turning off filmic but by converting the viewport color to the material color.

I would guess maybe I could take the hex value from looking at the color wheel for the viewport and the enter it in an RGB node in the shader graph to translate that to whatever filmic and the hdri would make although of course the value of the sunlight would be variable and the surrounding environment. Don’t know just a thought.

Then I thought maybe I could do it with a driver, but couldn’t get the R.G.B channels specifically, to send to the other R.G.B channels.

Could you clarify which colors you mean? Where are they located? Screenshots could be helpful.

You should be able to get the channels from viewport color like this:

[different channels accessed through “r”, “g” and “b”]

Awesome, it works, I was trying it with Diffuse Color because I saw it in the drivers or with bpy.data.materials["Material"].diffuse_color[0]. Also any chance its possible to get the formula or conversion to filmic or somehow adjust for HDRI, as in the original post. I think this is certainly a long shot but thanks for your help.

Sorry, got absolute zero knowledge about Color Management I’m afraid =’)
[and HDRI is all about lighting so not sure it even makes sense?]

Ok, sorry to be a pain but how would I driver the viewport color with the base color, in other words the reverse of before.

trying this:

bpy.data.materials["Material.015"].node_tree.nodes["Principled BSDF"].inputs[0].default_value

Just add to that a letter like before to access individual channels

Fantastic thanks, don’t know what I did wrong but it works.

Thank You.