To square or not to square

I was playing around with rgb to hex conversion. But when I took the rgb values from a colour in blender, multiplied them with 255 and then converted them to a hex code, it gave me a more saturated colour after copying the hex code back into blender. After a bit of playing around I found out that before multiplying a number with 255 you should first take the square root of that number. This confuses me because I can’t find any mention of this anywhere. And I don’t know if, when for instance copying the metal base colour values from the pbr encyclopedia I should square the numbers before copying them into blender or not.

It would be great if someone could shine some light on this situation.

also depends on color std RGB or sRGB ?
might also need some Gamma correction !

easier to use the HEX value I think

happy bl

I’m guessing it’s not square root but gamma, so 2.2 (or inverse 0.45) rather than 2.0 (or inverse 0.5).
Why don’t you just paste image into UV editor and use color picker to select rather than dealing with hex conversion? I don’t know if images you want to use are in linear or gamma color space, but whatever they are they should at least be consistent.

I’m pretty sure this answers my question. I’m pretty new to this stuff and wasn’t aware of the difference between RGB and sRGB. Thanks :slight_smile: