<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Farooq Azam &#187; convert</title>
	<atom:link href="http://www.farooqazam.net/tag/convert/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.farooqazam.net</link>
	<description>C# &#38; .NET Programming Blog</description>
	<lastBuildDate>Fri, 23 Jul 2010 20:15:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Convert color to hex using C#</title>
		<link>http://www.farooqazam.net/convert-color-to-hex-using-c-sharp/</link>
		<comments>http://www.farooqazam.net/convert-color-to-hex-using-c-sharp/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 17:50:44 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=155</guid>
		<description><![CDATA[So you want convert a .NET color to hex or a hex color to .NET color. Well, its very easy to do this. We won&#8217;t have to write lots of code or a special class for it. Thanks to ColorTranslator class. We can convert between these with only 1 line of code. Here&#8217;s how its [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-top: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.farooqazam.net%2Fconvert-color-to-hex-using-c-sharp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.farooqazam.net%2Fconvert-color-to-hex-using-c-sharp%2F&amp;source=farooqaaa&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>So you want convert a .NET color to hex or a hex color to .NET color. Well, its very easy to do this. We won&#8217;t have to write lots of code or a special class for it. Thanks to ColorTranslator class. We can convert between these with only 1 line of code. Here&#8217;s how its done:</p>
<p>To convert a Hex color to .NET color use this code:</p>
<pre class="brush: csharp;">Color color = ColorTranslator.FromHtml(&quot;#000000&quot;);</pre>
<p>For converting a .NET color to Hex color, use thise code:</p>
<pre class="brush: csharp;">Color color = Color.FromArgb(0, 100, 50, 100);

// Get the hex color
string HexColor = ColorTranslator.ToHtml(color);
 </pre>
<p>That was simple &amp; easy. If you have any questions don&#8217;t hesitate to leave a comment.</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/convert-color-to-hex-using-c-sharp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
