Mercurial > hg > xemacs-beta
diff src/objects-msw.c @ 243:f220cc83d72e r20-5b20
Import from CVS: tag r20-5b20
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:17:07 +0200 |
parents | 41f2f0e326e9 |
children | 51092a27c943 |
line wrap: on
line diff
--- a/src/objects-msw.c Mon Aug 13 10:16:17 2007 +0200 +++ b/src/objects-msw.c Mon Aug 13 10:17:07 2007 +0200 @@ -829,9 +829,13 @@ mswindows_color_instance_rgb_components (struct Lisp_Color_Instance *c) { COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c); - return (list3 (make_int (GetRValue(color)<<8), - make_int (GetGValue(color)<<8), - make_int (GetBValue(color)<<8))); + /* This used to say GetXValue(color)<<8, but that made, e.g. white + show as (#xff00 #xff00 #xff00) instead of (#xffff #xffff #xffff). + This slightly kludgier variant gives the expected results for + black and white, while hopefully not introducing too much error. */ + return list3 (make_int (GetRValue (color) * 257), + make_int (GetGValue (color) * 257), + make_int (GetBValue (color) * 257)); } static int