Skip to content

Inconsistent colors when passing hex value vs Color object to meshBasicMaterial #1613

Answered by drcmda
pichiste asked this question in Q&A
Discussion options

You must be logged in to vote

r3f has auto color management. that means colors will be consistent with photoshop/blender in the srgb color space and have a correct gamma. threejs has incorrect gamma, it's colors blow out. but r3f won't mutate externals, so if you want to provide your own color you must convert it yourself: const color = new Color(hex).convertSRGBToLinear() this is what you would normally have to do to any color and texture systemwide in plain three, see: https://www.donmccurdy.com/2020/06/17/color-management-in-threejs

you can switch off color management, but i would not recommend it:

<Canvas linear>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pichiste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1612 on August 30, 2021 07:34.