{"id":74,"date":"2008-09-18T01:31:34","date_gmt":"2008-09-17T23:31:34","guid":{"rendered":"https:\/\/interactive-developer.com\/blog\/?p=74"},"modified":"2010-01-29T22:58:58","modified_gmt":"2010-01-29T20:58:58","slug":"rgb-to-hexadecimal-in-actionscript","status":"publish","type":"post","link":"https:\/\/ixdc.net\/blog\/2008\/09\/18\/rgb-to-hexadecimal-in-actionscript\/","title":{"rendered":"RGB to Hexadecimal in ActionScript"},"content":{"rendered":"<p>The following method simply converts a given RGB value to hexadecimal format..<br \/>\ni.e. 0 > #000000<\/p>\n<pre lang=\"actionscript3\">\r\npublic function getProperColor(input:int):String {\r\n\tvar color:String = \"#\";\r\n\tvar checker:Number = 0;\r\n\tif (input.toString(16).length<6) {\r\n\t\twhile (checker<6-input.toString(16).length) {\r\n\t\t\tcolor += \"0\";\r\n\t\t\tchecker++;\r\n\t\t}\r\n\t}\r\n\tcolor += input.toString(16);\r\n\treturn color;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following method simply converts a given RGB value to hexadecimal format.. i.e. 0 > #000000 public function getProperColor(input:int):String { var color:String = &#8220;#&#8221;; var checker:Number = 0; if (input.toString(16).length<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[3,37,17,16],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-1","category-sep","tag-actionscript","tag-as3","tag-hexadecimal","tag-rgb"],"_links":{"self":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":0,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixdc.net\/blog\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}