<?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>jQuery Tutorials &#38; Plugins &#187; color picker plugin</title>
	<atom:link href="http://jqueryblog.net/tag/color-picker-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://jqueryblog.net</link>
	<description></description>
	<lastBuildDate>Mon, 05 Jul 2010 08:45:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Farbtastic: jQuery color picker plugin</title>
		<link>http://jqueryblog.net/2009/11/farbtastic-jquery-color-picker-plugin/</link>
		<comments>http://jqueryblog.net/2009/11/farbtastic-jquery-color-picker-plugin/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:55:47 +0000</pubDate>
		<dc:creator>Osman Erdo&#287;an</dc:creator>
				<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[color picker]]></category>
		<category><![CDATA[color picker plugin]]></category>
		<category><![CDATA[Farbtastic]]></category>
		<category><![CDATA[Farbtastic color picker]]></category>
		<category><![CDATA[jquery color picker plugin]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://jqueryblog.net/?p=44</guid>
		<description><![CDATA[Farbtastic is a jQuery plug-in that can add one or more color picker widgets into a page through JavaScript. Each widget is then linked to an existing element (e.g. a text field) and will update the element&#8217;s value when a color is selected.
Usage:
1- Include farbtastic.js and farbtastic.css in your HTML:
&#60;script type=&#34;text/javascript&#34; src=&#34;farbtastic.js&#34;&#62;&#60;/script&#62;
&#60;link rel=&#34;stylesheet&#34; href=&#34;farbtastic.css&#34; type=&#34;text/css&#34; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjqueryblog.net%2F2009%2F11%2Ffarbtastic-jquery-color-picker-plugin%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjqueryblog.net%2F2009%2F11%2Ffarbtastic-jquery-color-picker-plugin%2F" height="61" width="51" /></a></div><p>Farbtastic is a jQuery plug-in that can add one or more color picker widgets into a page through JavaScript. Each widget is then linked to an existing element (e.g. a text field) and will update the element&#8217;s value when a color is selected.</p>
<p><strong>Usage:</strong></p>
<p>1- Include farbtastic.js and farbtastic.css in your HTML:</p>
<pre class="brush: xml;">&lt;script type=&quot;text/javascript&quot; src=&quot;farbtastic.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;farbtastic.css&quot; type=&quot;text/css&quot; /&gt;</pre>
<p>2- Add a placeholder div and a text field to your HTML, and give each an ID:</p>
<pre class="brush: xml;">&lt;form&gt;&lt;input type=&quot;text&quot; id=&quot;color&quot; name=&quot;color&quot; value=&quot;#123456&quot; /&gt;&lt;/form&gt;
&lt;div id=&quot;colorpicker&quot;&gt;&lt;/div&gt;</pre>
<p>3- Add a ready() handler to the document which initializes the color picker and link it to the text field with the following syntax:</p>
<pre class="brush: jscript;">$(document).ready(function() {
    $('#colorpicker').farbtastic('#color');
  });</pre>
<p><strong><img style="margin: 5px; float:left" title="color picker" src="http://jqueryblog.net/wp-content/uploads/2009/11/temp2.png" alt="color picker" width="218" height="298" />Advanced Usage:</strong></p>
<p><strong>jQuery Method<br />
</strong><strong> $(&#8230;).farbtastic()<br />
$(&#8230;).farbtastic(callback)</strong><br />
This creates color pickers in the selected objects. callback is optional and can be a:<br />
DOM Node, jQuery object or jQuery selector: the color picker will be linked to the selected element(s) by syncing the value (for form elements) and color (all elements).<br />
Function: this function will be called whenever the user chooses a different color. It should have the following signature:<br />
function callback(color) { &#8230; }</p>
<p>With color the chosen color in hex representation (e.g. &#8216;#123456&#8242;).<br />
<strong> Object<br />
</strong><strong> $.farbtastic(placeholder)<br />
$.farbtastic(placeholder, callback)</strong><br />
Invoking $.farbtastic(placeholder) is the same as using $(placeholder).farbtastic() except that the Farbtastic object is returned instead of the jQuery object. This allows you to use the Farbtastic methods and properties below.<br />
Note that there is only one Farbtastic object per placeholder. If you call $.farbtastic(placeholder) twice with the same placeholder, you will get the same object back each time.</p>
<p>The optional callback argument behaves exactly as for the jQuery method.<br />
<strong> Methods<br />
</strong><strong> .linkTo(callback)<br />
</strong> Allows you to set a new callback. Any existing callbacks are removed. See above for the meaning of callback.<br />
<strong> .setColor(string)<br />
</strong> Sets the picker color to the given color in hex representation (e.g. &#8216;#123456&#8242;).<br />
<strong> .setColor([h, s, l])<br />
</strong> Sets the picker color to the given color in normalized HSL (0..1 scale).<br />
<strong> Properties<br />
</strong><strong> .linked<br />
</strong> The elements (jQuery object) or callback function this picker is linked to.<br />
<strong> .color<br />
</strong> Current color in hex representation (e.g. &#8216;#123456&#8242;).<br />
<strong> .hsl<br />
</strong> Current color in normalized HSL (e.g. [0.3, 0.4, 0.5]).</p>
<p><a href="http://acko.net/dev/farbtastic" target="_blank">Demo</a> &#8211; <a href="http://acko.net/files/farbtastic_/farbtastic12.zip" target="_blank">Download</a> &#8211; <a href="http://acko.net/dev/farbtastic" target="_blank">Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jqueryblog.net/2009/11/farbtastic-jquery-color-picker-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
