]> Dogcows Code - chaz/openbox/commitdiff
more efficient/nicer way to get the XColor values
authorDana Jansens <danakj@orodu.net>
Wed, 12 Feb 2003 01:22:31 +0000 (01:22 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 12 Feb 2003 01:22:31 +0000 (01:22 +0000)
otk/rendercolor.cc

index 5917b00732bba72a70ebb08c10946c3deaad1fba..31823341c7e61bfae81851544ceca1eef2a59c43 100644 (file)
@@ -61,9 +61,9 @@ void RenderColor::create()
     const ScreenInfo *info = display->screenInfo(_screen);
 
     XColor xcol;    // convert from 0-0xff to 0-0xffff
-    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.red = _red << 8 | _red;
+    xcol.green = _green << 8 | _green;
+    xcol.blue = _blue << 8 | _blue;
     xcol.pixel = 0;
 
     if (! XAllocColor(**display, info->colormap(), &xcol)) {
This page took 0.023276 seconds and 4 git commands to generate.