code: function( wysiwygeditor, forecolor )
          {
              var $content = $('<table/>')
                              .prop('cellpadding','0')
                              .prop('cellspacing','0')
                              .prop('unselectable','on');
              for( var row=1; row < 15; ++row ) // should be '16' - but last line looks so dark
              {
                  var $rows = $('<tr/>');
                  for( var col=0; col < 25; ++col ) // last column is grayscale
                  {
                      var color;
                      if( col == 24 )
                      {
                          var gray = Math.floor(255 / 13 * (14 - row)).toString(16);
                          var hexg = (gray.length < 2 ? '0' : '') + gray;
                          color = '#' + hexg + hexg + hexg;
                      }
                      else
                      {
                          var hue        = col / 24;
                          var saturation = row <= 8 ? row     /8 : 1;
                          var value      = row  > 8 ? (16-row)/8 : 1;
                          color = HSVtoRGB( hue, saturation, value );
                      }
                      $('<td/>').addClass('wysiwyg-toolbar-color')
                                .prop('title', color)
                                .prop('unselectable','on')
                                .css({backgroundColor: color})
                                .click(function(){
                                    var color = this.title;
                                    if( forecolor )
                                        wysiwygeditor.forecolor( color ).closePopup().collapseSelection();
                                    else
                                        wysiwygeditor.highlight( color ).closePopup().collapseSelection();
                                    return false;
                                })
                                .appendTo( $rows );
                  }
                  $content.append( $rows );
              }
              return $content;
          }
docs: Content: Color palette