title: Magento backend: How to add jscolor?
body: <p>I am trying to add a colorpicker in the backend of Magento. So far i have probabaly the class. (see below). But i have no idea how the Data.php file should look like. an anyone help or give me an example?</p>
  
  <p>Greets</p>
  
  <pre><code>class Namespace_Module_Block_System_Config_Form_Field_Colorpicker extends Mage_Adminhtml_Block_System_Config_Form_Field
  {
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
  {
      $url  = Mage::getBaseUrl('js');
      $element-&gt;addClass("color");
      $output = "";
      if(!defined("_LOADED_JSCOLOR_")){
          $jspath = $url.'jscolor/jscolor.js';
          $output .= '&lt;script type="text/javascript" src="'.$jspath.'"&gt;&lt;/script&gt;';
          define("_LOADED_JSCOLOR_",1);
      }
      $output .= $element-&gt;getElementHtml();
      return $output;
  }
  </code></pre>
  
  <p>}</p>