This is a much debated topic to be honest. Some people have the idea to map 127, others to 128 others to different values like in the case above Brecht was using (x/255) + 0.5
At the end of the day the direct conversion for the Brush color only: I found that Blender is using is HEX value converted to 0-255 value then divided by 255 gives the transformation exactly to the non-gamma-corrected linear value for RGB and displays the correct HEX value in the color picker that I started with every time (I have tested over a100+ different color selections)