diff options
author | das <das> | 2007-11-01 11:36:22 (GMT) |
---|---|---|
committer | das <das> | 2007-11-01 11:36:22 (GMT) |
commit | 6d142ca5c6cfc999c06128748af7b9958d6517c7 (patch) | |
tree | 2149e571eed9facb6d51c5de82676b33c827f994 /macosx/tkMacOSXColor.c | |
parent | ae0d1d0b0c0c0da9b9740f79802008ea55487cef (diff) | |
download | tk-6d142ca5c6cfc999c06128748af7b9958d6517c7.zip tk-6d142ca5c6cfc999c06128748af7b9958d6517c7.tar.gz tk-6d142ca5c6cfc999c06128748af7b9958d6517c7.tar.bz2 |
* macosx/tkMacOSXColor.c (GetThemeColor): improve translation of RGB
pixel values into RGBColor.
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r-- | macosx/tkMacOSXColor.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 697610d..c3150a4 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXColor.c,v 1.13 2007/07/02 13:05:14 das Exp $ + * RCS: @(#) $Id: tkMacOSXColor.c,v 1.14 2007/11/01 11:36:22 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -253,9 +253,12 @@ GetThemeColor( } else if (textColor) { err = ChkErr(GetThemeTextColor, textColor, 32, true, c); } else { - c->red = ((pixel >> 16) & 0xff) << 8; - c->green = ((pixel >> 8) & 0xff) << 8; - c->blue = ((pixel ) & 0xff) << 8; + c->red = (pixel >> 16) & 0xff; + c->green = (pixel >> 8) & 0xff; + c->blue = (pixel ) & 0xff; + c->red |= c->red << 8; + c->green |= c->green << 8; + c->blue |= c->blue << 8; } return err; } |