Why does setting color on a material with hex string and THREE.Color object produces different results?

Viewed 232

When I set the color on the material as a Hex String, the mesh is rendered with a color close to what I expect. But when I set it with an instance of THREE.Color(sameHexString), the mesh has a different color.

I have a simplified code that reproduces this: https://codesandbox.io/s/mystifying-wind-qhp99?file=/src/App.js

With linear on the <Canvas> both meshes are rendered with same color, but a different color than the previous 2.

1 Answers

The link to the discussion that @prisoner849 commented described the exact problem. Thanks @prisoner849.

Converting the Color instance solved this problem. For more details follow the discussion.

new THREE.Color(hexString).convertSRGBToLinear()
Related