Should these two expressions result in colors which are roughly the same?
Color.FromArgb(255, 255, 255, (byte)0.25 * 255))
Color.FromScRgb(1.0f, 1.0f, 1.0f,
Same answer as already mentioned - they do not map linearly ( they are different colour spaces - ScRGB is not SRGB with higher precision )
To mzzzzb "@FurqanSafdar the solution you have given may be correct. but thats not the point here, the thing is that -- intuitively we assume them to be linearly related. btw how did you get to that solution"
( We all know what assume does. ) Perhaps it would have been better to link to the definitions of sRGB and ScRGB ! Also, given that they are different color spaces with different ranges, why would you assume ?
You can see the source code and what is being performed:
FromScRGB
FromArgb
In particular the conversion functions:
ScRgbTosRgb
sRgbToScRgb
The ScRgbTosRgb function is the ColorFloatToByte mentioned by Furqan Safdar.