{"id":24830,"date":"2017-09-08T18:24:30","date_gmt":"2017-09-08T12:54:30","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24830"},"modified":"2017-09-08T18:24:30","modified_gmt":"2017-09-08T12:54:30","slug":"setcolor-function-c","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/setcolor-function-c\/","title":{"rendered":"setcolor function in c"},"content":{"rendered":"<p>Declaration :- void setcolor(int color);<\/p>\n<p>In Turbo Graphics each color is assigned a number. Total 16 colors are available. Strictly speaking number of available colors depends on current graphics mode and driver.For Example :- BLACK is assigned 0, RED is assigned 4 etc. setcolor function is used to change the current drawing color.e.g. setcolor(RED) or setcolor(4) changes the current drawing color to RED. Remember that default drawing color is WHITE.<\/p>\n<h2 id=\"c-programming-code-for-setcolor\">C programming code for setcolor<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-c code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-c code-embed-code\">#include&lt;graphics.h&gt;<br\/>#include&lt;conio.h&gt;<br\/> <br\/>main()<br\/>{<br\/>   int gd = DETECT, gm;<br\/>   initgraph(&amp;gd,&amp;gm,&quot;C:\\\\TC\\\\BGI&quot;);<br\/> <br\/>   circle(100,100,50);          \/* drawn in white color *\/ <br\/>   setcolor(RED);<br\/>   circle(200,200,50);          \/* drawn in red color   *\/<br\/> <br\/>   getch();<br\/>   closegraph();<br\/>   return 0;<br\/>}<\/code><\/pre> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>setcolor function in c &#8211; c programming -Total 16 colors are available. Strictly speaking number of available colors depends on current graphics mode .<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[83068,83065,83062,83066,83064,83069,83071,83070,83063,83067],"class_list":["post-24830","post","type-post","status-publish","format-standard","hentry","category-coding","tag-c-programming-color-text","tag-color-code-in-c","tag-color-codes-in-c-graphics","tag-floodfill-in-c-graphics","tag-setbkcolor-function-in-computer-graphics","tag-setcolor-c","tag-setcolor-color","tag-setcolor-java","tag-setfillstyle-function-in-computer-graphics","tag-settextstyle-function-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=24830"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24830\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}