diff -urpN ../../panels-6.x-3.0-rc1/css/color.css ./css/color.css
--- ../../panels-6.x-3.0-rc1/css/color.css	1969-12-31 19:00:00.000000000 -0500
+++ ./css/color.css	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,79 @@
+/* $Id$ */
+
+/* Farbtastic placement */
+.color-form {
+  max-width: 50em;
+  position: relative;
+}
+#placeholder {
+  position: absolute;
+  top: 0;
+  right: 0; /* LTR */
+}
+
+/* Palette */
+.color-form .form-item {
+  height: 2em;
+  line-height: 2em;
+  padding-left: 1em; /* LTR */
+  margin: 0.5em 0;
+}
+.color-form label {
+  float: left; /* LTR */
+  clear: left; /* LTR */
+  width: 10em;
+}
+.color-form .form-text, .color-form .form-select {
+  float: left; /* LTR */
+}
+.color-form .form-text {
+  text-align: center;
+  margin-right: 5px; /* LTR */
+  cursor: pointer;
+}
+
+#palette .hook {
+  float: left; /* LTR */
+  margin-top: 3px;
+  width: 16px;
+  height: 16px;
+}
+#palette .down, #palette .up, #palette .both {
+  background: url(images/hook.png) no-repeat 100% 0; /* LTR */
+}
+#palette .up {
+  background-position: 100% -27px; /* LTR */
+}
+#palette .both {
+  background-position: 100% -54px; /* LTR */
+}
+
+#palette .lock {
+  float: left; /* LTR */
+  position: relative;
+  top: -1.4em;
+  left: -10px; /* LTR */
+  width: 20px;
+  height: 25px;
+  background: url(images/lock.png) no-repeat 50% 2px;
+  cursor: pointer;
+}
+#palette .unlocked {
+  background-position: 50% -22px;
+}
+#palette .form-item {
+  width: 30em;
+}
+#palette .item-selected {
+  background: #eee;
+}
+
+/* Preview */
+#preview {
+  display: none;
+}
+html.js #preview {
+  display: block;
+  position: relative;
+  float: left; /* LTR */
+}
diff -urpN ../../panels-6.x-3.0-rc1/includes/display-color.inc ./includes/display-color.inc
--- ../../panels-6.x-3.0-rc1/includes/display-color.inc	1969-12-31 19:00:00.000000000 -0500
+++ ./includes/display-color.inc	2009-07-28 14:57:02.000000000 -0400
@@ -0,0 +1,252 @@
+<?php
+// $Id$
+
+/*
+ * @file display-color.inc
+ * Core Panels API include file containing various display-editing and
+ * rendering functions to allow users to change colors of style css elements
+ * and images.
+ */
+function panels_edit_style_settings_color_form($style_settings, $display, $pid, $type, $style) {
+  /* partially imported from color.module */
+  $form['color'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Color scheme'),
+    '#weight' => -1,
+    '#attributes' => array('id' => 'color_scheme_form', 'class' => 'panels-color-edit'),
+    '#theme' => 'panels_color_scheme_form',
+  );
+
+  $base = drupal_get_path('module', 'color');
+
+  // Add palette fields
+  if($type == 'pane') {
+    if(isset($display->content[$pid]->style['settings']['color']['palette'])) {
+      $set_palette = $display->content[$pid]->style['settings']['color']['palette'];
+    }
+
+    /* This is used if the parent panel has defaults set */
+    if(!empty($display->panel_settings['style_settings']['default']['color'])) {
+      $panel_settings = $display->panel_settings['style_settings']['default']['color']['palette'];
+    }
+  } else if(isset($style_settings['color']['palette'])) {
+    $set_palette = $style_settings['color']['palette'];
+  }
+
+  $form['color']['palette']['#tree'] = true;
+
+  foreach ($style['color palette'] as $color_id => $value) {
+    if(isset($panel_settings)) {
+      $default = isset($panel_settings[$color_id]) ? $panel_settings[$color_id] : $value['default_value'];
+    } else {
+      $default = $value['default_value'];
+    }
+
+    $form['color']['palette'][$color_id] = array(
+      '#type' => 'textfield',
+      '#title' => $value['label'],
+      '#default_value' => isset($set_palette[$color_id]) ? $set_palette[$color_id] : $default,
+      '#size' => 8,
+    );
+  }
+
+  return $form['color'];
+}
+
+/* I found I needed these special ids to keep track of cached image files
+ * and CSS. Maybe there's a better way by putting this into ctools, or we 
+ * could save this information permanently into $display somewhere else...
+ */
+function panels_color_create_unique_names($display)
+{
+  foreach ($display->panels as $id => $panes) {
+    foreach ((array) $panes as $pid) {
+      $file_ids[] = 'pane-'.$display->did . '-' . $pid;
+    }
+
+    $file_ids[] .= 'panels-panel-region-' . $display->did . '-' . $id;
+  }
+
+  $file_ids[] .= 'panels-panel-' . $display->did;
+  return $file_ids;
+}
+
+function panels_color_clear_panel_cache($display)
+{
+  $file_ids = panels_color_create_unique_names($display);
+
+  ctools_include('css');
+
+  foreach($file_ids as $id) {
+    $filename = ctools_css_retrieve('colors-'.$id);
+
+    if($filename) {
+      ctools_css_clear('colors-'.$id);
+    }
+   _panels_recursive_delete('panels_color/' . $id);
+  }
+}
+
+/**
+ * Taken from the imagecache module.
+ *
+ * Recursively delete all files and folders in the specified filepath, then
+ * delete the containing folder.
+ *
+ * Note that this only deletes visible files with write permission.
+ *
+ * @param string $path
+ *   A filepath relative to file_directory_path.
+ */
+function _panels_recursive_delete($path) {
+  $path = file_directory_path() . '/' . $path;
+  $listing = $path .'/*';
+
+  foreach (glob($listing) as $file) {
+    if (is_file($file) === TRUE) {
+      @unlink($file);
+    }
+    elseif (is_dir($file) === TRUE) {
+      _panels_recursive_delete($file);
+    }
+  }
+
+  @rmdir($path);
+}
+
+/**
+ * Theme color form.
+ *
+ * @ingroup @themeable
+ */
+function theme_panels_color_scheme_form($form) {
+  $output = '';
+  // Wrapper
+  $output .= '<div class="color-form clear-block">';
+
+  // Color schemes
+  $output .= drupal_render($form['scheme']);
+
+  // Palette
+  $output .= '<div id="palette" class="clear-block">';
+  foreach (element_children($form['palette']) as $name) {
+    $output .= drupal_render($form['palette'][$name]);
+  }
+  $output .= '</div>';
+
+/*  // Preview
+  $output .= drupal_render($form);
+  $output .= '<h2>'. t('Preview') .'</h2>';
+  $output .= '<div id="preview"><div id="text"><h2>Lorem ipsum dolor</h2><p>Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <a href="#">exercitation ullamco</a> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p></div><div id="img" style="background-image: url('. base_path() . $path . $info['preview_image'] .')"></div></div>';
+
+  // Close wrapper
+  $output .= '</div>';
+*/
+  return $output;
+}
+
+function panels_color_perform_image_actions($style, $style_settings, $name) 
+{
+  $palette = $style_settings['color']['palette'];
+  $path = file_create_path('panels_color/' . $name);
+
+  if (!file_check_directory($path)) {
+    $path = file_directory_path() . '/panels_color';
+    file_check_directory($path, FILE_CREATE_DIRECTORY);
+    $path .= '/'. $name;
+    file_check_directory($path, FILE_CREATE_DIRECTORY);
+  }
+
+  foreach($palette as $name => $value) {
+    $settings = $style['color palette'][$name];
+
+    if(isset($settings['colorize'])) {
+      foreach($settings['colorize'] as $filename) {
+        $image = panels_get_path($style['image_path']) . '/' . $filename;
+
+        $source = imagecreatefrompng($image);
+        $new_image = $path . '/' . $filename;
+
+        imagealphablending($source, false);
+        imagesavealpha($source, true);
+        $size = getimagesize($image);
+        $L=$size[0];
+        $H=$size[1];
+
+        $c = _panels_color_unpack($value);
+ 
+        for($j=0;$j<$H;$j++){  
+          for($i=0;$i<$L;$i++){
+            $rgb = imagecolorat($source, $i, $j);
+            $current = imagecolorsforindex($source, $rgb);
+            $new_color = imagecolorallocatealpha($source, $c[0], $c[1], $c[2], $current['alpha'] ); 
+            imagesetpixel($source, $i, $j, $new_color);  
+          }
+        }
+
+        // Save image.
+        imagepng($source, $new_image);
+        imagedestroy($source);
+
+        // Set standard file permissions for webserver-generated files
+        @chmod(realpath($new_image), 0664);
+
+      }
+    }
+  }
+}
+
+/**
+ * Convert a hex color into an RGB triplet.
+ */
+function _panels_color_unpack($hex, $normalize = false) {
+  $hex = str_replace("#", "", $hex);
+
+  if (strlen($hex) == 4) {
+    $hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
+  }
+  $c = hexdec($hex);
+  for ($i = 16; $i >= 0; $i -= 8) {
+    $out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1);
+  }
+  return $out;
+}
+
+
+
+/* Adds color pane specific css to the head of the document */
+function panels_render_add_color_css($style, $style_settings, $name) {
+  $idstr = '.' . $name;
+
+  $file = 'colors-' . $name;
+
+  ctools_include('css');
+  $filename = ctools_css_retrieve($file);
+
+  if (!$filename) {
+    $filename = ctools_css_store($file, _panels_render_print_color_css($style, $style_settings, $idstr), FALSE);
+  }
+
+  drupal_add_css($filename, 'module', 'all', FALSE);
+}
+
+function _panels_render_print_color_css($pstyle, $style_settings, $idstr) {
+  $css = '';
+
+  $palette = $style_settings['color']['palette'];
+
+  foreach($palette as $name => $value) {
+    $settings = $pstyle['color palette'][$name];
+    $attr = $settings['attr'];
+    if(isset($attr)) {
+      foreach($settings['selector'] as $sel) {
+        $additional = !empty($settings['additional']) ? $settings['additional'] : '';
+        $css .= "$idstr $sel { $attr : $value $additional }"; 
+      }
+    }
+  }
+
+  return $css;
+}
+
+
diff -urpN ../../panels-6.x-3.0-rc1/includes/display-edit.inc ./includes/display-edit.inc
--- ../../panels-6.x-3.0-rc1/includes/display-edit.inc	2009-07-21 20:15:50.000000000 -0400
+++ ./includes/display-edit.inc	2009-07-28 15:24:42.000000000 -0400
@@ -163,8 +163,12 @@ function panels_edit_display_form(&$form
 
   drupal_add_js(panels_get_path('js/panels-base.js'));
   drupal_add_js(panels_get_path('js/display_editor.js'));
+  drupal_add_js(panels_get_path('js/panels-color.js'));
+  drupal_add_js('misc/farbtastic/farbtastic.js');
+  drupal_add_css('misc/farbtastic/farbtastic.css');
   drupal_add_css(panels_get_path('css/panels_dnd.css'));
   drupal_add_css(panels_get_path('css/panels_admin.css'));
+  drupal_add_css(panels_get_path('css/color.css'));
 
   $css = array();
   $js = array(drupal_get_path('module', 'ctools') . '/js/dependent.js' => TRUE);
@@ -237,7 +241,8 @@ function panels_edit_display_get_links(&
     'href' => 'panels/ajax/style-type/display/' . $cache_key,
     'attributes' => array('class' => 'ctools-use-modal'),
   );
-  if (panels_plugin_get_function('style', $style, 'settings form')) {
+  if (panels_plugin_get_function('style', $style, 'settings form') || 
+      isset($style['color palette'])) {
     $links[] = array(
       'title' => ' -- ' . t('Style settings'),
       'href' => 'panels/ajax/style-settings/display/' . $cache_key,
@@ -342,7 +347,8 @@ function panels_edit_panel_get_links($di
     'href' => 'panels/ajax/style-type/panel/' . $cache_key . '/' . $panel_id,
     'attributes' => array('class' => 'ctools-use-modal'),
   );
-  if (panels_plugin_get_function('style', $style, 'settings form')) {
+  if (panels_plugin_get_function('style', $style, 'settings form') ||
+      isset($style['color palette'])) {
     $links[] = array(
       'title' => ' -- ' . t('Style settings'),
       'href' => 'panels/ajax/style-settings/panel/' . $cache_key . '/' . $panel_id,
@@ -462,7 +468,8 @@ function panels_show_pane($display, $pan
     'attributes' => array('class' => 'ctools-use-modal'),
   );
 
-  if (panels_plugin_get_function('style', $style, 'pane settings form')) {
+  if (panels_plugin_get_function('style', $style, 'pane settings form') ||
+      isset($style['color palette'])) {
     $links[] = array(
       'title' => ' -- ' . t('Style settings'),
       'href' => 'panels/ajax/style-settings/pane/' . $cache_key . '/' . $pane->pid,
@@ -1231,7 +1238,8 @@ function panels_ajax_style_type($type, $
     // have saved the form.
     $style = panels_get_style($form_state['style']);
     $function = panels_plugin_get_function('style', $style, ($type == 'pane') ? 'pane settings form' : 'settings form');
-    if (!$function) {
+
+    if (!$function && !isset($style['color palette'])) {
       // If there's no settings form, just change the style and exit.
       switch($type) {
         case 'display':
@@ -1402,6 +1410,7 @@ function panels_ajax_style_settings($typ
       break;
 
     case 'pane':
+      ctools_include('content');
       $pane = &$cache->display->content[$pid];
       $conf = &$pane->style['settings'];
       $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
@@ -1467,8 +1476,16 @@ function panels_edit_style_settings_form
   );
 
   $function = panels_plugin_get_function('cache', $style, ($type == 'pane') ? 'pane settings form' : 'settings form');
+  
+  if($function) {
+    $form['settings'] = $function($conf, $display, $pid, $type);
+  }
+
+  if(!empty($style['color palette'])) {
+    panels_load_include('display-color');
+    $form['settings']['color'] = panels_edit_style_settings_color_form($conf, $display, $pid, $type, $style);
+  }
 
-  $form['settings'] = $function($conf, $display, $pid, $type);
   $form['settings']['#tree'] = TRUE;
 
   $form['submit'] = array(
@@ -1493,6 +1510,9 @@ function panels_edit_style_settings_form
  * Allows panel styles to validate their style settings.
  */
 function panels_edit_style_settings_form_submit($form, &$form_state) {
+  /* TODO: Validate color form here?
+   * Clear pane cache.
+   */
   $name = $form_state['type'] == 'pane' ? 'pane settings form submit' : 'settings form submit';
   if ($function = panels_plugin_get_function('style', $form_state['style'], $name)) {
     $function($form_state['values']['settings']);
@@ -1878,3 +1898,4 @@ function panels_render_pane_collapsible(
   $output .= '<div class="pane-content">' . filter_xss_admin($block->content) . '</div>';
   return $output;
 }
+
diff -urpN ../../panels-6.x-3.0-rc1/includes/display-render.inc ./includes/display-render.inc
--- ../../panels-6.x-3.0-rc1/includes/display-render.inc	2009-07-20 21:21:21.000000000 -0400
+++ ./includes/display-render.inc	2009-07-28 14:47:10.000000000 -0400
@@ -218,6 +218,17 @@ function panels_render_pane_content(&$di
  *   The display.
  */
 function panels_render_pane($content, $pane, $display) {
+  if(!empty($pane->style['settings']['color']['palette'])) {
+    $name = 'pane-'.$pane->did . '-' . $pane->pid;
+    $pstyle = panels_get_style($pane->style['style']);
+
+    panels_load_include('display-color');
+    panels_render_add_color_css($pstyle, $pane->style['settings'], $name);
+    panels_color_perform_image_actions($pstyle, $pane->style['settings'], $name);
+  }
+
+  $pane_idstr = 'pane-'.$pane->did . '-' . $pane->pid;
+
   if (!empty($pane->style['style'])) {
     $style = panels_get_style($pane->style['style']);
 
@@ -226,14 +237,15 @@ function panels_render_pane($content, $p
 
       // This could be null if no theme function existed.
       if (isset($output)) {
-        return $output;
+        /* This should probably be in a theme function */
+        return "<div class=\"$pane_idstr\">" . $output . '</div>';
       }
     }
   }
 
   if (!empty($content)) {
     // fallback
-    return theme('panels_pane', $content, $pane, $display);
+    return "<div class=\"$pane_idstr\">" . theme('panels_pane', $content, $pane, $display) . '</div>';
   }
 }
 
@@ -290,6 +302,18 @@ function panels_render_panel($display, $
     $owner_id = $display->owner->id;
   }
 
+  if(isset($display->panel_settings[$panel]) && $display->panel_settings[$panel]['style'] == 'color_rounded_corners') {
+    $panel_name = 'panels-panel-region-' . $display->did . '-' . $panel;
+  } else {
+    $panel_name = 'panels-panel' . '-' . $display->did;
+  }
+
+  if(!empty($style['color palette'])) {
+    panels_load_include('display-color');
+    panels_render_add_color_css($style, $style_settings, $panel_name);
+    panels_color_perform_image_actions($style, $style_settings, $panel_name);
+  }
+
   return theme($style['render panel'], $display, $owner_id, $panes, $style_settings, $panel);
 }
 
@@ -318,7 +342,7 @@ function theme_panels_pane($content, $pa
       $classstr = ' ' . $content->css_class;
     }
 
-    $output = "<div class=\"panel-pane$classstr\"$idstr>\n";
+    $output = "<div class=\"panel-pane$classstr\"$idstr><div class=\"inner-pane\">\n";
     if (user_access('view pane admin links') && !empty($content->admin_links)) {
       $output .= "<div class=\"admin-links panel-hide\">" . theme('links', $content->admin_links) . "</div>\n";
     }
@@ -344,7 +368,7 @@ function theme_panels_pane($content, $pa
       $output .= "<div class=\"more-link\">" . l($content->more['title'], $content->more['href']) . "</div>\n";
     }
 
-    $output .= "</div>\n";
+    $output .= "</div></div>\n";
     return $output;
   }
 }
diff -urpN ../../panels-6.x-3.0-rc1/includes/plugins.inc ./includes/plugins.inc
--- ../../panels-6.x-3.0-rc1/includes/plugins.inc	2009-04-20 18:31:26.000000000 -0400
+++ ./includes/plugins.inc	2009-07-28 14:47:10.000000000 -0400
@@ -123,6 +123,10 @@ function panels_set_cached_content($cach
  * Clear all cached content for a display.
  */
 function panels_clear_cached_content($display) {
+  /* delete this display's image cache */
+  panels_load_include('display-color');
+  panels_color_clear_panel_cache($display);
+
   // Figure out every method we might be using to cache content in this display:
   $methods = array();
   if (!empty($display->cache['method'])) {
diff -urpN ../../panels-6.x-3.0-rc1/js/panels-color.js ./js/panels-color.js
--- ../../panels-6.x-3.0-rc1/js/panels-color.js	1969-12-31 19:00:00.000000000 -0500
+++ ./js/panels-color.js	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,261 @@
+// $Id: color.js,v 1.6 2007/09/12 18:29:32 goba Exp $
+
+Drupal.Panels.Color = {}
+
+Drupal.Panels.Color.addFarbtastic = function(context) {
+  // This behavior attaches by ID, so is only valid once on a page.
+  if ($('#color_scheme_form .color-form.color-processed').size()) {
+    return;
+  }
+
+  var form = $('.color-form', context);
+  var inputs = [];
+  var hooks = [];
+  var locks = [];
+  var focused = null;
+
+  // Add Farbtastic
+  $(form).prepend('<div id="placeholder"></div>').addClass('color-processed');
+  var farb = $.farbtastic('#placeholder');
+
+  // Decode reference colors to HSL
+/*var reference = Drupal.settings.color.reference.clone();
+  for (i in reference) {
+    reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
+  } */
+  // Build preview
+  $('#preview:not(.color-processed)')
+    .append('<div id="gradient"></div>')
+    .addClass('color-processed');
+  var gradient = $('#preview #gradient');
+  var h = parseInt(gradient.css('height')) / 10;
+  for (i = 0; i < h; ++i) {
+    gradient.append('<div class="gradient-line"></div>');
+  }
+
+  // Fix preview background in IE6
+  if (navigator.appVersion.match(/MSIE [0-6]\./)) {
+    var e = $('#preview #img')[0];
+    var image = e.currentStyle.backgroundImage;
+    e.style.backgroundImage = 'none';
+    e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image.substring(5, image.length - 2) + "')";
+  }
+
+  // Set up colorscheme selector
+  $('#edit-scheme', form).change(function () {
+    var colors = this.options[this.selectedIndex].value;
+    if (colors != '') {
+      colors = colors.split(',');
+      for (i in colors) {
+        callback(inputs[i], colors[i], false, true);
+      }
+      preview();
+    }
+  });
+
+  /**
+   * Render the preview.
+   */
+  function preview() {
+    // Solid background
+    $('#preview', form).css('backgroundColor', inputs[0].value);
+
+    // Text preview
+    $('#text', form).css('color', inputs[4].value);
+    $('#text a, #text h2', form).css('color', inputs[1].value);
+
+    // Set up gradient
+    var top = farb.unpack(inputs[2].value);
+    var bottom = farb.unpack(inputs[3].value);
+    if (top && bottom) {
+      var delta = [];
+      for (i in top) {
+        delta[i] = (bottom[i] - top[i]) / h;
+      }
+      var accum = top;
+
+      // Render gradient lines
+      $('#gradient > div', form).each(function () {
+        for (i in accum) {
+          accum[i] += delta[i];
+        }
+        this.style.backgroundColor = farb.pack(accum);
+      });
+    }
+  }
+
+  /**
+   * Shift a given color, using a reference pair (ref in HSL).
+   *
+   * This algorithm ensures relative ordering on the saturation and luminance
+   * axes is preserved, and performs a simple hue shift.
+   *
+   * It is also symmetrical. If: shift_color(c, a, b) == d,
+   *                        then shift_color(d, b, a) == c.
+   */
+  function shift_color(given, ref1, ref2) {
+    // Convert to HSL
+    given = farb.RGBToHSL(farb.unpack(given));
+
+    // Hue: apply delta
+    given[0] += ref2[0] - ref1[0];
+
+    // Saturation: interpolate
+    if (ref1[1] == 0 || ref2[1] == 0) {
+      given[1] = ref2[1];
+    }
+    else {
+      var d = ref1[1] / ref2[1];
+      if (d > 1) {
+        given[1] /= d;
+      }
+      else {
+        given[1] = 1 - (1 - given[1]) * d;
+      }
+    }
+
+    // Luminance: interpolate
+    if (ref1[2] == 0 || ref2[2] == 0) {
+      given[2] = ref2[2];
+    }
+    else {
+      var d = ref1[2] / ref2[2];
+      if (d > 1) {
+        given[2] /= d;
+      }
+      else {
+        given[2] = 1 - (1 - given[2]) * d;
+      }
+    }
+
+    return farb.pack(farb.HSLToRGB(given));
+  }
+
+  /**
+   * Callback for Farbtastic when a new color is chosen.
+   */
+  function callback(input, color, propagate, colorscheme) {
+    // Set background/foreground color
+    $(input).css({
+      backgroundColor: color,
+      'color': farb.RGBToHSL(farb.unpack(color))[2] > 0.5 ? '#000' : '#fff'
+    });
+
+    // Change input value
+    if (input.value && input.value != color) {
+      input.value = color;
+
+      // Update locked values
+      if (propagate) {
+        var i = input.i;
+        for (j = i + 1; ; ++j) {
+          if (!locks[j - 1] || $(locks[j - 1]).is('.unlocked')) break;
+          var matched = shift_color(color, reference[input.key], reference[inputs[j].key]);
+          callback(inputs[j], matched, false);
+        }
+        for (j = i - 1; ; --j) {
+          if (!locks[j] || $(locks[j]).is('.unlocked')) break;
+          var matched = shift_color(color, reference[input.key], reference[inputs[j].key]);
+          callback(inputs[j], matched, false);
+        }
+
+        // Update preview
+        preview();
+      }
+
+      // Reset colorscheme selector
+      if (!colorscheme) {
+        resetScheme();
+      }
+    }
+
+  }
+
+  /**
+   * Reset the color scheme selector.
+   */
+  function resetScheme() {
+    $('#edit-scheme', form).each(function () {
+      this.selectedIndex = this.options.length - 1;
+    });
+  }
+
+  // Focus the Farbtastic on a particular field.
+  function focus() {
+    var input = this;
+    // Remove old bindings
+    focused && $(focused).unbind('keyup', farb.updateValue)
+        .unbind('keyup', preview).unbind('keyup', resetScheme)
+        .parent().removeClass('item-selected');
+
+    // Add new bindings
+    focused = this;
+    farb.linkTo(function (color) { callback(input, color, true, false); });
+    farb.setColor(this.value);
+    $(focused).keyup(farb.updateValue).keyup(preview).keyup(resetScheme)
+      .parent().addClass('item-selected');
+  }
+
+  // Initialize color fields
+  $('#palette input.form-text', form)
+  .each(function () {
+    // Extract palette field name
+    this.key = this.id.substring(13);
+
+    // Link to color picker temporarily to initialize.
+    farb.linkTo(function () {}).setColor('#000').linkTo(this);
+
+    // Add lock
+    var i = inputs.length;
+    if (inputs.length) {
+      var lock = $('<div class="lock"></div>').toggle(
+        function () {
+          $(this).addClass('unlocked');
+          $(hooks[i - 1]).attr('class',
+            locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook up' : 'hook'
+          );
+          $(hooks[i]).attr('class',
+            locks[i] && $(locks[i]).is(':not(.unlocked)') ? 'hook down' : 'hook'
+          );
+        },
+        function () {
+          $(this).removeClass('unlocked');
+          $(hooks[i - 1]).attr('class',
+            locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook both' : 'hook down'
+          );
+          $(hooks[i]).attr('class',
+            locks[i] && $(locks[i]).is(':not(.unlocked)') ? 'hook both' : 'hook up'
+          );
+        }
+      );
+      $(this).after(lock);
+      locks.push(lock);
+    };
+
+    // Add hook
+    var hook = $('<div class="hook"></div>');
+    $(this).after(hook);
+    hooks.push(hook);
+
+    $(this).parent().find('.lock').click();
+    this.i = i;
+    inputs.push(this);
+  })
+  .focus(focus);
+
+  $('#palette label', form);
+
+  // Focus first color
+  focus.call(inputs[0]);
+
+  // Render preview
+  preview();
+};
+
+Drupal.behaviors.PanelsColorSettings = function() {
+  $('.panels-color-edit:not(.panels-color-processed)')
+    .addClass('panels-color-processed')
+    .each(function() {
+      Drupal.Panels.Color.addFarbtastic('#' + $(this).attr('id'));
+    });
+}
diff -urpN ../../panels-6.x-3.0-rc1/panels.module ./panels.module
--- ../../panels-6.x-3.0-rc1/panels.module	2009-07-21 20:15:49.000000000 -0400
+++ ./panels.module	2009-07-28 14:47:10.000000000 -0400
@@ -61,6 +61,11 @@ function panels_theme() {
     'template' => 'panels-dashboard',
   );
 
+  $theme['panels_color_scheme_form'] = array(
+    'arguments' => array('form' => NULL),
+    'file' => 'includes/display-edit.inc',
+  );
+
   // Register layout and style themes on behalf of all of these items.
   panels_load_include('plugins');
 
@@ -107,6 +112,7 @@ function panels_theme() {
     }
   }
 
+
   return $theme;
 }
 
@@ -765,6 +771,7 @@ function panels_save_display(&$display) 
 
     $display->panels[$id] = $new_panes;
   }
+
   if (!empty($pids)) {
     db_query("DELETE FROM {panels_pane} WHERE pid IN (" . db_placeholders($pids) . ")", $pids);
   }
@@ -786,6 +793,11 @@ function panels_delete_display($display)
   else {
     $did = $display;
   }
+
+  /* Necessary ? */
+  panels_load_include('display-color');
+  panels_color_clear_panel_cache($display);
+
   db_query("DELETE FROM {panels_display} WHERE did = %d", $did);
   db_query("DELETE FROM {panels_pane} WHERE did = %d", $did);
 }
diff -urpN ../../panels-6.x-3.0-rc1/plugins/styles/color_corners/color_rounded_corners.inc ./plugins/styles/color_corners/color_rounded_corners.inc
--- ../../panels-6.x-3.0-rc1/plugins/styles/color_corners/color_rounded_corners.inc	1969-12-31 19:00:00.000000000 -0500
+++ ./plugins/styles/color_corners/color_rounded_corners.inc	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,252 @@
+<?php
+// $Id$
+
+/**
+ * @file styles/color_rounded_corners.inc
+ * Definition of the 'color_rounded_corners' panel style.
+ */
+
+// ---------------------------------------------------------------------------
+// Panels hooks.
+
+/**
+ * Implementation of hook_panels_style_info().
+ */
+function panels_color_rounded_corners_panels_styles() {
+  return array(
+    'color_rounded_corners' => array(
+      'title' => t('Colored rounded corners'),
+      'description' => t('Presents the panes or panels with a rounded corner box around them'),
+      'render panel' => 'panels_color_rounded_corners_style_render_panel',
+      'render pane' => 'panels_color_rounded_corners_style_render_pane',
+      'color palette' => array(
+                 array('label' => 'Corner Color', 
+                       'default_value' => '#78BAE3',
+                       'selector' => array('.m .m-inner', '.l-edge', '.r-edge'),
+                       'attr' => 'background-color',
+                       'colorize' => array('corner-bits2.png'),
+                 ),
+       ),
+      'image_path' => 'plugins/styles/color_corners',
+      'settings form' => 'panels_color_rounded_corners_style_settings_form',
+      'hook theme' => array(
+        'panels_color_rounded_corners_box' => array(
+          'arguments' => array('content' => NULL),
+          'path' => panels_get_path('plugins/styles/color_corners'),
+          'template' => 'panels-color-rounded-corners-box',
+        ),
+      ),
+    ),
+  );
+}
+
+// ---------------------------------------------------------------------------
+// Panels style plugin callbacks.
+
+/**
+ * Render callback.
+ *
+ * @ingroup themeable
+ */
+function theme_panels_color_rounded_corners_style_render_panel($display, $panel_id, $panes, $settings, $panel) {
+  $output = '';
+
+  // Determine where to put the box. If empty or 'pane' around each pane. If
+  // 'panel' then just around the whole panel.
+  $where = empty($settings['corner_location']) ? 'pane' : $settings['corner_location'];
+
+  $print_separator = FALSE;
+  foreach ($panes as $pane_id => $pane) {
+    $text = panels_render_pane($pane, $display->content[$pane_id], $display);
+    if ($text) {
+      // Add the separator if we've already displayed a pane.
+      if ($print_separator) {
+        $output .= '<div class="panel-separator">&nbsp;</div>';
+      }
+
+      if ($where == 'pane') {
+        $pane_name = 'pane-' . $display->did . '-' . $pane_id;
+        $output .= theme('panels_color_rounded_corners_box', $text);
+        panels_add_color_rounded_corners_css($display, $where, $pane_name);
+      }
+      else {
+        $output .= $text;
+        $print_separator = TRUE;
+      }
+    }
+  }
+
+  /* Check to see if this region was configured as a colored rounded corner
+   * style. If so we use images generated for that region and not the ones made
+   * for the entire panel. 
+   */
+  if(isset($display->panel_settings[$panel]) && $display->panel_settings[$panel]['style'] == 'color_rounded_corners') {
+    $panel_name = 'panels-panel-region-' . $display->did . '-' . $panel;
+  } else {
+    $panel_name = 'panels-panel' . '-' . $display->did;
+  }
+
+  if ($where == 'panel') {
+    $panel_output = "<div class=\"$panel_name\">";
+    $panel_output .= theme('panels_color_rounded_corners_box', $output);
+    $panel_output .= "</div>";
+    $output = $panel_output;
+  } else {
+    $output = "<div class=\"$panel_name\">$output</div>";
+  }
+
+  panels_add_color_rounded_corners_css($display, $where, $panel_name);
+
+  return $output;
+}
+
+function panels_add_color_rounded_corners_css($display, $where, $name, $important = FALSE) {
+  static $displays_used = array();
+
+  panels_color_rounded_corners_css($display, $where, $name, $important);
+  $displays_used[$display->css_id] = TRUE;
+}
+
+/**
+ * Render callback for a single pane.
+ */
+function theme_panels_color_rounded_corners_style_render_pane($content, $pane, $display) {
+  $output = theme('panels_pane', $content, $pane, $display);
+
+  if (!$output) {
+    return;
+  }
+
+  // Just stick a box around the standard theme_panels_pane.
+  $output = theme('panels_color_rounded_corners_box', $output);
+
+  $pane_name = 'pane-' . $display->did . '-' . $pane->pid;
+  panels_add_color_rounded_corners_css($display, 'pane', $pane_name, TRUE);
+
+  return $output;
+}
+
+/**
+ * Settings form callback.
+ */
+function panels_color_rounded_corners_style_settings_form($style_settings) {
+  $form['corner_location'] = array(
+    '#type' => 'select',
+    '#title' => t('Box around'),
+    '#options' => array(
+      'pane' => t('Each pane'),
+      'panel' => t('Each region'),
+    ),
+    '#default_value' => (isset($style_settings['corner_location'])) ? $style_settings['corner_location'] : 'ul',
+    '#description' => t('Choose whether to include the box around each pane (piece of content) or panel (each column or region)'),
+  );
+
+  return $form;
+}
+
+/**
+ * Generates the dynamic CSS.
+ *
+ * @param $display
+ *   A Panels display object.
+ */
+function panels_color_rounded_corners_css($display, $where, $name, $important = FALSE) {
+  $idstr = '.' . $name;
+
+  $css_id = 'rounded-corner:' . $idstr;
+  $image_path = '/' . file_create_path('panels_color/' . $name);
+
+  ctools_include('css');
+  $filename = ctools_css_retrieve($css_id);
+  if (!$filename) {
+    $filename = ctools_css_store($css_id, _panels_color_rounded_corners_css($idstr, $where, $image_path, $important), FALSE);
+  }
+
+  drupal_add_css($filename, 'module', 'all', FALSE);
+}
+
+/**
+ * Generates the dynamic CSS.
+ */
+function _panels_color_rounded_corners_css($idstr, $where, $image_path, $important) {
+  $url = panels_get_path('plugins/styles/color_corners', TRUE);
+
+  $maybe_important = "";
+  if($important == TRUE) {
+    $maybe_important = "!important";
+  }
+
+  $css = <<<EOF
+
+.t-edge, .b-edge, .l-edge, .r-edge, .wrap-color-corner {
+  position: relative;
+  /* hasLayout -1 ? For IE only */
+  zoom: 1;
+}
+$idstr .t-edge {
+  font-size: 1px;
+}
+
+$idstr .t-edge .m {
+  backgound-color: black;
+}
+
+$idstr .t-edge .m, $idstr .b-edge .m {
+  height:11px;
+  padding:0 11px;
+  width:auto;
+}
+
+$idstr .t-edge .m .m-inner,
+$idstr .b-edge .m .m-inner {
+  height:11px;
+  width:auto;
+}
+
+$idstr .b-edge {
+  font-size: 1px;
+}
+$idstr .wrap-color-corner .t-edge, $idstr .wrap-color-corner .b-edge {
+  height: 11px;
+}
+$idstr .wrap-color-corner .l, $idstr .wrap-color-corner .r {
+  position: absolute;
+  top: 0;
+  height: 11px;
+  width: 11px;
+  background-image: url($image_path/corner-bits2.png) $maybe_important;
+}
+$idstr .wrap-color-corner .l {
+  left: 0;
+}
+$idstr .wrap-color-corner .r {
+  right: 0;
+  background-position: -11px 0;
+}
+$idstr .wrap-color-corner .b-edge .l {
+  background-position: 0 -11px;
+}
+$idstr .wrap-color-corner .b-edge .r {
+  background-position: -11px -11px;
+}
+$idstr .wrap-color-corner .r-edge {
+  padding: 5px 24px;
+}
+$idstr div.admin-links {
+  margin-top: -14px;
+  margin-left: -12px;
+}
+
+$idstr .panel-separator {
+  font-size: 1px;
+  height: 30px;
+}
+
+$idstr .rounded-color-corner {
+  margin-bottom: 1em;
+}
+
+EOF;
+
+  return $css;
+}
Binary files ../../panels-6.x-3.0-rc1/plugins/styles/color_corners/corner-bits2.png and ./plugins/styles/color_corners/corner-bits2.png differ
diff -urpN ../../panels-6.x-3.0-rc1/plugins/styles/color_corners/panels-color-rounded-corners-box.tpl.php ./plugins/styles/color_corners/panels-color-rounded-corners-box.tpl.php
--- ../../panels-6.x-3.0-rc1/plugins/styles/color_corners/panels-color-rounded-corners-box.tpl.php	1969-12-31 19:00:00.000000000 -0500
+++ ./plugins/styles/color_corners/panels-color-rounded-corners-box.tpl.php	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,21 @@
+<?php
+// $Id$
+/**
+ * @file
+ *
+ * Display the box for rounded corners.
+ *
+ * - $content: The content of the box.
+ */
+?>
+<div class="rounded-color-corner">
+  <div class="wrap-color-corner">
+    <div class="t-edge"><div class="l"></div><div class="m"><div class="m-inner"></div></div><div class="r"></div></div>
+    <div class="l-edge">
+      <div class="r-edge clear-block">
+        <?php print $content; ?>
+      </div>
+    </div>
+    <div class="b-edge"><div class="l"></div><div class="m"><div class="m-inner"></div></div><div class="r"></div></div>
+  </div>
+</div>
diff -urpN ../../panels-6.x-3.0-rc1/plugins/styles/color_panels/color_panels.css ./plugins/styles/color_panels/color_panels.css
--- ../../panels-6.x-3.0-rc1/plugins/styles/color_panels/color_panels.css	1969-12-31 19:00:00.000000000 -0500
+++ ./plugins/styles/color_panels/color_panels.css	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,16 @@
+/* $Id$ */
+
+.color-panel h2.title, .color-panel .content {
+  padding-left: 5px;
+  padding-right: 5px;
+  padding-top: 5px;
+}
+
+/* Maybe more for demo purposes than anything else
+ * This makes nodes in color panes look better in Garland
+ */
+.color-panel .node {
+  border-bottom: 0;
+  padding-top: 5px;
+  padding-bottom: 5px;
+}
diff -urpN ../../panels-6.x-3.0-rc1/plugins/styles/color_panels/color_panels.inc ./plugins/styles/color_panels/color_panels.inc
--- ../../panels-6.x-3.0-rc1/plugins/styles/color_panels/color_panels.inc	1969-12-31 19:00:00.000000000 -0500
+++ ./plugins/styles/color_panels/color_panels.inc	2009-07-28 14:47:10.000000000 -0400
@@ -0,0 +1,71 @@
+<?php
+// $Id$
+
+/**
+ * @file styles/color_panels/color_panels.inc
+ * Definition of the 'color_panels' panel style.
+ */
+
+// ---------------------------------------------------------------------------
+// Panels hooks.
+
+/**
+ * Implementation of hook_panels_style_info().
+ */
+function panels_color_panels_panels_styles() {
+  return array(
+    'color_panels' => array(
+      'title' => t('Color Panes'),
+      'description' => t('Presents the panes or panels in a square style with user configurable colors'),
+      'render pane' => 'panels_color_panels_style_render_pane',
+      'pane settings form' => 'panels_color_panels_style_pane_settings_form',
+      'color palette' => array(
+                 array('label' => 'Border Color', 'default_value' => '#78BAE3',
+                       'selector' => array('.inner-pane'), 'attr' => 'border',
+                       'additional' => '1px solid'),
+                 array('label' => 'Background', 'default_value' => '#FFFFFF',  
+                       'selector' => array(), 'attr' => 'background-color'), 
+                 array('label' => 'Header Background', 
+                       'default_value' => '#3D9CD7', 
+                       'selector' => array('h2.title'), 
+                       'attr' => 'background-color'), 
+                 array('label' => 'Header Text Color', 
+                       'default_value' => '#FFFFFF',
+                       'selector' => array('h2.title'), 'attr' => 'color'),
+                 array('label' => 'Text Color', 'default_value' => '#000000', 
+                       'selector' => array(), 'attr' => 'color'),
+               ),
+      'hook theme' => array(
+        'panels_color_panels_box' => array(
+          'arguments' => array('content' => NULL),
+          'path' => panels_get_path('plugins/styles/color_panels'),
+          'template' => 'panels-color-panels-box',
+        ),
+      ),
+    ),
+  );
+}
+
+// ---------------------------------------------------------------------------
+// Panels style plugin callbacks.
+
+function panels_add_color_panels_css($display) {
+  $base = drupal_get_path('module', 'panels');
+
+  drupal_add_css($base .'/plugins/styles/color_panels/color_panels.css', 'module', 'all', FALSE);
+}
+
+/**
+ * Render callback for a single pane.
+ */
+function theme_panels_color_panels_style_render_pane($content, $pane, $display) {
+  $output = theme('panels_pane', $content, $pane, $display);
+
+  if (!$output) {
+    return;
+  }
+
+  $output = '<div class="color-panel">' . $output . '</div>';
+  panels_add_color_panels_css($display, 'pane');
+  return $output;
+}
