Hi,
Please see the code below.
Code:
for (i=0; i<= 255; i++)
{
sprintf(spec, "rgb:%02x/%02x/%02x", i, i, i);
if(XParseColor(display, default_cmap, spec, &color))
{
XAllocColor(display, default_cmap, &color);
}
}
then I am printing color.red, color.blue and color.green values. These values range from 0 to 65535.
If I understand it correctly, Each color (R, G, B) has 8-bits each, so values should range from 0 to 255.
Please help me understand why the values are 256 times the expected values.