XLib - Development - Error message - Debug

I am trying to write a software to draw simple shapes under X. I use the XLib. Every went smoothly at the begining. As I need some flashing colors, I tried to create my own colormap. After creating a window with the right visaul (DirectColor), I tried to create my colormap with the same visual and I get the following error message: X Error of failed request:  BadValue (integer parameter out of range for operation)   Major opcode of failed request:  78 (X_CreateColormap)   Value in failed request:  0x0   Serial number of failed request:  9   Current serial number in output stream:  11 I have no idea how to debug this. Which value, which integer. Does the problem come from my Ubuntu? Does anyone have any idea? Is Ubuntu compliant with X standarts?