{"id":233955,"date":"2021-04-23T15:00:10","date_gmt":"2021-04-23T12:00:10","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/why-text-in-the-terminal-only-has-sixteen-colors-cloudsavvy-it\/"},"modified":"2021-04-23T15:00:10","modified_gmt":"2021-04-23T12:00:10","slug":"why-text-in-the-terminal-only-has-sixteen-colors-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/why-text-in-the-terminal-only-has-sixteen-colors-cloudsavvy-it\/","title":{"rendered":"#Why Text in The Terminal Only Has Sixteen Colors \u2013 CloudSavvy IT"},"content":{"rendered":"<p><strong>&#8220;#Why Text in The Terminal Only Has Sixteen Colors \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10805\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/04\/56568fe0.png?width=1200&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"350\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you\u2019ve paid much attention to the Linux terminal window, or the Windows console, you might notice that text only comes in a limited set of colors. Why do the colors look the way they do? How IBM chose to represent text color on the original PC set the standard for text color to follow.<\/p>\n<p>The original 1981 IBM Personal Computer used a monochrome display, where all text was green on plain black background. Not long after, IBM introduced the Color Graphics Adapter, or CGA, which was the first to support color.\u00a0In those early days of PC history, memory was limited, so IBM squeezed the most features out of that limited data.<\/p>\n<p>You can display any color by combining different amounts of pure red, green, and blue light. This mix of Red+Green+Blue (or \u201cRGB\u201d) is the basis for all PC colors.\u00a0Let\u2019s start with the simplest case where you might mix equal amounts of red, green, and blue light. Representing this combination requires either an \u201con\u201d or an \u201coff\u201d value for each component of \u201cRGB.\u201d And remember that an \u201con\u201d or \u201coff\u201d is also called a \u201cbit\u201d in computer terminology: 1 or 0.<\/p>\n<p>In that simplest case, you might assume one bit to represent each color: red, green, and blue. If any of the \u201cRGB\u201d bits are 1, then display the red, green, or blue light at full intensity. This gives eight possible colors:<\/p>\n<table role=\"presentation\">\n<tbody>\n<tr>\n<td style=\"background-color: #000; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">000 Black<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #00f; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">001 Blue<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #0f0; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">010 Green<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #0ff; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">011 Cyan<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f00; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">100 Red<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #f0f; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">101 Magenta<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #ff0; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">110 Yellow<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #fff; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">111 White<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You can double the number of colors by adding an extra bit, and that\u2019s how IBM defined the CGA standard. Instead of just three bits as \u201cRGB,\u201d CGA implemented colors as \u201ciRGB,\u201d where the first bit was the \u201cintensity.\u201d If the first bit was set to 1, then the PC would display the color at full brightness. If the first bit was set to 0, then it would display the color at a lower brightness.<\/p>\n<p>IBM actually implemented a modified \u201ciRGB\u201d model. If the \u201cintensity\u201d bit was 0, then any 1\u2019s in \u201cRGB\u201d meant the red, green, or blue colors were set to two-thirds brightness. And if the \u201cintensity\u201d bit was 1, then any 1\u2019s in \u201cRGB\u201d meant the red, green, or blue were set to full brightness, but any 0\u2019s in \u201cRGB\u201d were set to one-third brightness. The only exception was 0110, which received a one-third green (\u201cG\u201d) brightness, which turned the \u201clow intensity yellow\u201d into an orange or brown color.<\/p>\n<table role=\"presentation\">\n<tbody>\n<tr>\n<td style=\"background-color: #000; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0000 Black<\/td>\n<td style=\"background-color: #555; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1000 Bright Black<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #00a; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0001 Blue<\/td>\n<td style=\"background-color: #55f; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1001 Bright Blue<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #0a0; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0010 Green<\/td>\n<td style=\"background-color: #5f5; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1010 Bright Green<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #0aa; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0011 Cyan<\/td>\n<td style=\"background-color: #5ff; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1011 Bright Cyan<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #a00; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0100 Red<\/td>\n<td style=\"background-color: #f55; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1100 Bright Red<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #a0a; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0101 Magenta<\/td>\n<td style=\"background-color: #f5f; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1101 Bright Magenta<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #a50; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0110 Brown<\/td>\n<td style=\"background-color: #ff5; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1110 Yellow<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #aaa; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">0111 White<\/td>\n<td style=\"background-color: #fff; padding: 1em; width: 5em;\"\/>\n<td style=\"padding-left: .5em;\">1111 Bright White<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With this \u201ciRGB\u201d model, CGA was actually able to display sixteen colors: eight \u201clow intensity\u201d colors and eight \u201chigh intensity\u201d colors. For other technical reasons, the PC could only display the eight \u201clow intensity\u201d colors as background colors. But foreground text could take advantage of all sixteen colors.<\/p>\n<p>Today, terminal emulators like GNOME Terminal let you change the color palette. Depending on the colors you choose, you might see different colors than those shown here, but you\u2019re still limited to sixteen text colors and eight background colors.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/10664\/why-text-in-the-terminal-only-has-sixteen-colors\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#Why Text in The Terminal Only Has Sixteen Colors \u2013 CloudSavvy IT&#8221; If you\u2019ve paid much attention to the Linux terminal window, or the Windows console, you might notice that text only comes in a limited set of colors. Why do the colors look the way they do? How IBM chose to represent text color&#8230;<\/p>\n","protected":false},"author":1,"featured_media":233956,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/04\/56568fe0.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-233955","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/233955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=233955"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/233955\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/233956"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=233955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=233955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=233955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}