BABYLON.Color3.FromHexString() / DynamicTexture->getContext->fillStyle...Color values different

Hello,

For what reason are the color values, which are assigned once with albedoColor by ‘FromHexString ()’ and once in a dynamic texture with fillStyle = …, displayed differently?

Here’s a playground that shows this:

https://www.babylonjs-playground.com/#Z1VL3V#247

thanks
Olli

adding @Evgeni_Popov

The color you set in albedoColor is taken “as is”, whereas the albedoTexture is assumed to be in gammaSpace, so have .gammaSpace = true, meaning a conversion to linear space will be applied after being sampled.

If you want the same display, you can either:

1 Like

Hello,

Thanks for the quick answer and the solution to the problem.

Of course it was just a single line of source code again :roll_eyes:… I spent 2 days looking for the error …