{"id":1214,"date":"2010-07-22T18:59:00","date_gmt":"2010-07-22T10:59:00","guid":{"rendered":""},"modified":"2013-11-23T15:28:30","modified_gmt":"2013-11-23T07:28:30","slug":"c%e5%8d%81%e5%85%ad%e8%bf%9b%e5%88%b6%e9%a2%9c%e8%89%b2%e4%b8%8ecolor%e5%af%b9%e8%b1%a1%e7%9a%84%e4%ba%92%e7%9b%b8%e8%bd%ac%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/1214.html","title":{"rendered":"C#\u5341\u516d\u8fdb\u5236\u989c\u8272\u4e0eColor\u5bf9\u8c61\u7684\u4e92\u76f8\u8f6c\u6362"},"content":{"rendered":"<p>C#\u5341\u516d\u8fdb\u5236\u989c\u8272\u4e0eColor\u5bf9\u8c61\u7684\u4e92\u76f8\u8f6c\u6362<br \/>\n\u628a\u5341\u516d\u8fdb\u5236\u989c\u8272\u8f6c\u5316\u4e3acolor\u5bf9\u8c61<br \/>\nColorTranslator.FromHtml(&#8220;#FF0000&#8221;)<br \/>\n\u6216 ColorTranslator.FromHtml(&#8220;Red&#8221;);<\/p>\n<p>\u628acolor\u5bf9\u8c61\u8f6c\u5316\u4e3a\u5341\u516d\u8fdb\u5236\u989c\u8272<br \/>\nColorTranslator.ToHtml(Color.FromArgb(255,255,255))<br \/>\n\u6216 ColorTranslator.ToHtml(Color.Red);<\/p>\n<p>\/\/\u5341\u8fdb\u5236\u8f6c\u4e8c\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToString(69, 2));<br \/>\n\/\/\u5341\u8fdb\u5236\u8f6c\u516b\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToString(69, 8));<br \/>\n\/\/\u5341\u8fdb\u5236\u8f6c\u5341\u516d\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToString(69, 16));<br \/>\n\/\/\u4e8c\u8fdb\u5236\u8f6c\u5341\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToInt32(&#8220;100111101&#8221;, 2));<br \/>\n\/\/\u516b\u8fdb\u5236\u8f6c\u5341\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToInt32(&#8220;76&#8221;, 8));<br \/>\n\/\/\u5341\u516d\u8fdb\u5236\u8f6c\u5341\u8fdb\u5236<br \/>\nConsole.WriteLine(Convert.ToInt32(&#8220;FF&#8221;, 16));<\/p>\n<p>string color_s = ColorTranslator.ToHtml(g.Pen.Color);<br \/>\ncolor_s = color_s.Substring(1, color_s.Length &#8211; 1);<br \/>\ng.Pen.Color = ColorTranslator.FromHtml(&#8220;#&#8221;+Convert.ToString(Convert.ToInt32(color_s, 16)+40000, 16));<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C#\u5341\u516d\u8fdb\u5236\u989c\u8272\u4e0eColor\u5bf9\u8c61\u7684\u4e92\u76f8\u8f6c\u6362 \u628a\u5341\u516d\u8fdb\u5236\u989c\u8272\u8f6c\u5316\u4e3acolor\u5bf9\u8c61 ColorTranslator [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1214","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=1214"}],"version-history":[{"count":2,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1214\/revisions"}],"predecessor-version":[{"id":5164,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1214\/revisions\/5164"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=1214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=1214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=1214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}