Color spaces
#2
The color components in WPF are defined by byte values. So each color component (color.R, color.G, color.B) is a value from 0 to 255.

SharpDX (and DirectX) requires that the color components are in float values in the range from 0 to 1 - so the byte value needs to be multiplied by 1/255 (=0.003921569) to convert bytes to floats.


I have quickly checked the scRgb. If you create the color in WPF by calling Color.FromScRgb than this also sets the R, B and B properties to byte values in the sRGB space. The ToColor3 and ToColor4 methods use those values to convert the colors to float values.

The DXEngine does not support scRgb space so all colors need to be converted to sRGB. 

If you have a proposal on how to improve that in DXEngine, I would glad to hear that.
Andrej Benedik
  


Messages In This Thread
Color spaces - by janovrom - 02-03-2021, 02:14 PM
RE: Color spaces - by abenedik - 02-04-2021, 12:25 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)