{"id":24203,"date":"2007-12-12T10:00:00","date_gmt":"2007-12-12T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2007\/12\/12\/when-selecting-system-colors-match-but-dont-mix\/"},"modified":"2007-12-12T10:00:00","modified_gmt":"2007-12-12T10:00:00","slug":"when-selecting-system-colors-match-but-dont-mix","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20071212-00\/?p=24203","title":{"rendered":"When selecting system colors, match but don&#039;t mix"},"content":{"rendered":"<p>Here&#8217;s a question that came in from a customer:<\/p>\n<blockquote class=\"q\"><p> Is there a way to view all the Windows color schemes at once? We want to display text in the <code>COLOR_BTNTEXT<\/code> color against a background of <code>COLOR_INACTIVECAPTION<\/code>, and we want to check that this looks good in all of the themes. <\/p><\/blockquote>\n<p> A mistake I see from some programs is mixing system colors that are not meant to be mixed. The colors I&#8217;m talking about are the ones obtained from the <code>GetSysColor<\/code> function. Here are the text and background color pairs, with a sample of what those colors are <!--[if gte IE 5]&gt;     on your system right now. &lt;![endif]-->     on a default install of Windows&nbsp;XP.<\/p>\n<table>\n<tr>\n<th>Text<\/th>\n<th>Background<\/th>\n<th>Sample<\/th>\n<\/tr>\n<tr>\n<td><code>COLOR_WINDOWTEXT<\/code><\/td>\n<td><code>COLOR_WINDOW<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"window\"><font COLOR=\"windowtext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"white\"><font color=\"black\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_HOTLITE<\/code><\/td>\n<td><code>COLOR_WINDOW<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"window\"><font COLOR=\"blue\">sample*<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"white\"><font color=\"blue\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_HIGHLIGHTTEXT<\/code><\/td>\n<td><code>COLOR_HIGHLIGHT<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"highlight\"><font COLOR=\"highlighttext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"#316AC5\"><font color=\"white\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_INFOTEXT<\/code><\/td>\n<td><code>COLOR_INFOBK<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"infobackground\"><font COLOR=\"infotext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"#FFFFE1\"><font color=\"black\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_MENUTEXT<\/code><\/td>\n<td><code>COLOR_MENU<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"menu\"><font COLOR=\"menutext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"white\"><font color=\"black\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_BTNTEXT<\/code><\/td>\n<td><code>COLOR_BTNFACE<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"buttonface\"><font COLOR=\"buttontext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"#ECE9D8\"><font color=\"black\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_CAPTIONTEXT<\/code><\/td>\n<td><code>COLOR_ACTIVECAPTION<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"activecaption\"><font COLOR=\"captiontext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"#0054E3\"><font color=\"white\">sample<\/font><\/td>\n<\/tr>\n<tr>\n<td><code>COLOR_INACTIVECAPTIONTEXT<\/code><\/td>\n<td><code>COLOR_INACTIVECAPTION<\/code><\/td>\n<p> <!--[if gte IE 5]&gt;     \n\n<td BGCOLOR=\"inactivecaption\"><font COLOR=\"inactivecaptiontext\">sample<\/font><\/td>\n\n &lt;![endif]-->     <\/p>\n<td bgcolor=\"#7A96DF\"><font color=\"#D8E4F8\">sample<\/font><\/td>\n<\/tr>\n<\/table>\n<p> If you&#8217;re going to combine colors, and you need them to contrast against each other (for example, because you&#8217;re going to draw text with them as the foreground and background colors), choose a pair from one of the rows above. Do not choose colors from different rows because there is no guarantee that they will be readable against each other.\n For example, I like to use <font color=\"black\" style=\"background: #71FFFF\">black on #71FFFF<\/font> as my color scheme for highlighted text. I&#8217;ve seen programs which break the above rule and draw text in the <code>COLOR_HIGHLIGHT<\/code> color against a background of <code>COLOR_WINDOW<\/code>, on the assumption that the highlight color contrasts against the window color. (They get away with this in the default Windows&nbsp;XP color scheme because the window color is white and the highlight color is medium blue.) Unfortunately, on my machine, this results in <font color=\"#71FFFF\" style=\"background: white\">text that is extremely painful on the eyes<\/font>.\n Remember: When it comes to system colors, match. Don&#8217;t mix.<\/p>\n<p><!--[if gte IE 5]&gt; \n\n<p> <b>Footnote<\/b> <\/p>\n\n \n\n<p> *Internet Explorer does not have a built-in name for this system color, so I hard-coded blue. Sorry. <\/p>\n\n &lt;![endif]--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a question that came in from a customer: Is there a way to view all the Windows color schemes at once? We want to display text in the COLOR_BTNTEXT color against a background of COLOR_INACTIVECAPTION, and we want to check that this looks good in all of the themes. A mistake I see from [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-24203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Here&#8217;s a question that came in from a customer: Is there a way to view all the Windows color schemes at once? We want to display text in the COLOR_BTNTEXT color against a background of COLOR_INACTIVECAPTION, and we want to check that this looks good in all of the themes. A mistake I see from [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/24203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=24203"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/24203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=24203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=24203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=24203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}