svgedit/simple-colorpicker
Narendra Sisodiya 899d973ffb modified code
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@7 eee81c28-f429-11dd-99c0-75d572ba1ddd
2009-02-13 08:53:35 +00:00
..
README modified code 2009-02-13 08:53:35 +00:00
arrow.gif modified code 2009-02-13 08:53:35 +00:00
arrow.png modified code 2009-02-13 08:53:35 +00:00
colorPicker.css modified code 2009-02-13 08:53:35 +00:00
demo.html modified code 2009-02-13 08:53:35 +00:00
jquery.colorPicker.js modified code 2009-02-13 08:53:35 +00:00
screenshot.png modified code 2009-02-13 08:53:35 +00:00

README

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Really Simple Color Picker
-------------------------------

Written by Lakshan Perera 
For more info please visit: http://www.web2media.net/laktek/?p=96
Source code is hosted at: http://github.com/laktek/really-simple-color-picker

Color Picker requires jQuery 1.2.6 or higher. So make sure to load it before Color Picker (there's no other dependencies!). 
For default styles of the color picker load the CSS file that comes with the plugin.

 <script language="javascript" type="text/javascript" src=jquery.min.js"></script>
 <script language="javascript" type="text/javascript" src="jquery.colorPicker.js"/></script>

 <link rel="stylesheet" href="colorPicker.css" type="text/css" />

Add a text field to take the color input.
  <div><label for="color1">Color 1</label> <input id="color1" type="text" name="color1" value="#333399" /></div>

Then call 'colorPicker' method on the text field when document loads.
<script language="javascript">
  jQuery(document).ready(function($) {
    $('#color1').colorPicker();
  }
</script>

Your favorite colors are missing? 
Just add them to the palette
<script language="javascript">
  //use this method to add new colors to palette
  $.fn.colorPicker.addColors(['000', '000', 'fff', 'fff']);
</script>

Or completely change the color palette as you need...
<script language="javascript">
  $.fn.colorPicker.defaultColors = ['000', '000', 'fff', 'fff'];
</script>

Thats all you have to do!