- xcol.red = _red; xcol.red |= xcol.red << 8;
- xcol.green = _green; xcol.green |= xcol.green << 8;
- xcol.blue = _blue; xcol.blue |= xcol.blue << 8;
- xcol.pixel = 0;
-
- if (! XAllocColor(**display, info->colormap(), &xcol)) {
- fprintf(stderr, "RenderColor: color alloc error: rgb:%x/%x/%x\n",
- _red, _green, _blue);
- xcol.pixel = 0;
- }
+ xcol.red = (_red << 8) | _red;
+ xcol.green = (_green << 8) | _green;
+ xcol.blue = (_blue << 8) | _blue;
+
+ display->renderControl(_screen)->allocateColor(&xcol);
+ _allocated = true;