
jQuery.fn.addColorPicker=function(props){if(!props){props=[];}
props=jQuery.extend({blotchElemType:'span',blotchClass:'ColorBlotch',clickCallback:function(ignoredColor){},iterationCallback:null,fillString:'&nbsp;',fillStringX:'?',colors:['transparent','#ffffff','#d0d0d0','#777777','#000000','#ffaaaa','#ff00ff','#ff0000','#aa0000','#9000ff','#ff6c00','#ffff00','#ffbb00','#f0e68c','#d2b229','#aaffaa','#00ff00','#00aa00','#6b8e23','#007700','#bbddff','#00ffdd','#aaaaff','#0000ff','#0000aa']},props);var count=props.colors.length;for(var i=0;i<count;++i){var color=props.colors[i];if(!color)color='transparent';var elem=jQuery('<'+props.blotchElemType+'/>').addClass(props.blotchClass).css('background-color',color);elem.html(('transparent'==color)?props.fillStringX:props.fillString);if(props.clickCallback){elem.click(function(){props.clickCallback(jQuery(this).css('background-color'));});}
this.append(elem);if(props.iterationCallback)props.iterationCallback(this,elem,color,i);}
return this;};