Index: wp-content/themes/twentyfourteen/inc/customizer.php
===================================================================
--- wp-content/themes/twentyfourteen/inc/customizer.php	(revision 26018)
+++ wp-content/themes/twentyfourteen/inc/customizer.php	(working copy)
@@ -22,7 +22,7 @@
 	// Add the custom accent color setting and control.
 	$wp_customize->add_setting( 'accent_color', array(
 		'default'           => '#24890d',
-		'sanitize_callback' => 'twentyfourteen_generate_accent_colors',
+		'sanitize_callback' => 'sanitize_hex_color',
 	) );
 
 	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_color', array(
@@ -30,6 +30,9 @@
 		'section'  => 'colors',
 		'settings' => 'accent_color',
 	) ) );
+
+	add_filter( 'theme_mod_accent_mid',  'twentyfourteen_accent_mid'  );
+	add_filter( 'theme_mod_accent_light', 'twentyfourteen_accent_light' );
 
 	// Add the featured content section.
 	$wp_customize->add_section( 'featured_content', array(
@@ -67,24 +70,6 @@
 add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );
 
 /**
- * Generate two variants of the accent color, return the original, and
- * save the others as theme mods.
- *
- * @since Twenty Fourteen 1.0
- *
- * @param string $color The original color.
- * @return string $color The original color, sanitized.
- */
-function twentyfourteen_generate_accent_colors( $color ) {
-	$color = sanitize_hex_color( $color );
-
-	set_theme_mod( 'accent_lighter', twentyfourteen_adjust_color( $color, 29 ) );
-	set_theme_mod( 'accent_much_lighter', twentyfourteen_adjust_color( $color, 49 ) );
-
-	return $color;
-}
-
-/**
  * Tweak the brightness of a color by adjusting the RGB values by the given interval.
  *
  * Use positive values of $steps to brighten the color and negative values to darken the color.
@@ -106,21 +91,59 @@
 	// Convert hex to rgb.
 	$rgb = array( hexdec( substr( $color, 1, 2 ) ), hexdec( substr( $color, 3, 2 ) ), hexdec( substr( $color, 5, 2 ) ) );
 
-	// Adjust color and switch back to hex.
+	// Adjust color and switch back to 6-digit hex.
 	$hex = '#';
-	foreach ( $rgb as $c ) {
-		$c += $steps;
-		if ( $c > 255 )
-			$c = 255;
-		elseif ( $c < 0 )
-			$c = 0;
-		$hex .= str_pad( dechex( $c ), 2, '0', STR_PAD_LEFT);
+	foreach ( $rgb as $value ) {
+		$value += $steps;
+		if ( $value > 255 )
+			$value = 255;
+		elseif ( $value < 0 )
+			$value = 0;
+		$hex .= str_pad( dechex( $value ), 2, '0', STR_PAD_LEFT);
 	}
 
 	return $hex;
 }
 
+ /**
+ * Returns a slightly lighter color than what is set as the theme's
+ * accent color.
+ *
+ * @since Twenty Fourteen 1.0
+ *
+ * @return string
+ */
+function twentyfourteen_accent_mid() {
+	return twentyfourteen_adjust_color( get_theme_mod( 'accent_color' ), 29 );
+}
+
 /**
+ * Returns a lighter color than what is set as the theme's accent color.
+ *
+ * @since Twenty Fourteen 1.0
+ *
+ * @return string
+ */
+function twentyfourteen_accent_light() {
+	return twentyfourteen_adjust_color( get_theme_mod( 'accent_color' ), 49 );
+}
+
+/**
+ * Caches the generated variants of the theme's accent color.
+ *
+ * @since Twenty Fourteen 1.0
+ *
+ * @return void
+ */
+function twentyfourteen_rebuild_accent_colors() {
+	set_theme_mod( 'accent_mid',  twentyfourteen_accent_mid()  );
+	set_theme_mod( 'accent_light', twentyfourteen_accent_light() );
+}
+add_action( 'update_option_theme_mods_twentyfourteen', 'twentyfourteen_rebuild_accent_colors' );
+
+/**
  * Output the CSS for the Theme Customizer options.
  *
  * @since Twenty Fourteen 1.0
@@ -128,14 +151,14 @@
  * @return void
  */
 function twentyfourteen_customizer_styles() {
-	$accent_color = get_theme_mod( 'accent_color' );
+	$accent_color = get_theme_mod( 'accent_color', '#24890d' );
 
 	// Don't do anything if the current color is the default.
 	if ( '#24890d' === $accent_color )
 		return;
 
-	$accent_lighter = get_theme_mod( 'accent_lighter' );
-	$accent_much_lighter = get_theme_mod( 'accent_much_lighter' );
+	$accent_mid = get_theme_mod( 'accent_mid' );
+	$accent_light = get_theme_mod( 'accent_light' );
 
 	$css = '/* Custom accent color. */
 		a,
@@ -192,7 +215,7 @@
 			}
 		}
 
-		/* Generated variant of custom accent color: slightly lighter. */
+		/* Generated "mid" variant of custom accent color. */
 		button:hover,
 		button:focus,
 		.contributor-posts-link:hover,
@@ -220,7 +243,7 @@
 		.content-sidebar .widget input[type="submit"]:hover,
 		.content-sidebar .widget input[type="submit"]:focus,
 		.slider-control-paging a:hover:before {
-			background-color: ' . $accent_lighter . ';
+			background-color: ' . $accent_mid . ';
 		}
 
 		a:active,
@@ -245,22 +268,22 @@
 		.content-sidebar .widget_twentyfourteen_ephemera .entry-meta a:hover,
 		.site-info a:hover,
 		.featured-content a:hover {
-			color: ' . $accent_lighter . ';
+			color: ' . $accent_mid . ';
 		}
 
 		.page-links a:hover,
 		.paging-navigation a:hover {
-			border-color: ' . $accent_lighter . ';
+			border-color: ' . $accent_mid . ';
 		}
 
 		.tag-links a:hover:before {
-			border-right-color: ' . $accent_lighter . ';
+			border-right-color: ' . $accent_mid . ';
 		}
 
 		@media screen and (min-width: 782px) {
 			.primary-navigation ul ul a:hover,
 			.primary-navigation ul ul li.focus > a {
-				background-color: ' . $accent_lighter . ';
+				background-color: ' . $accent_mid . ';
 			}
 		}
 
@@ -267,11 +290,11 @@
 		@media screen and (min-width: 1008px) {
 			.secondary-navigation ul ul a:hover,
 			.secondary-navigation ul ul li.focus > a {
-				background-color: ' . $accent_lighter . ';
+				background-color: ' . $accent_mid . ';
 			}
 		}
 
-		/* Generated variant of custom accent color: much lighter. */
+		/* Generated "light" variant of custom accent color. */
 		button:active,
 		.contributor-posts-link:active,
 		input[type="button"]:active,
@@ -283,7 +306,7 @@
 		.content-sidebar .widget input[type="button"]:active,
 		.content-sidebar .widget input[type="reset"]:active,
 		.content-sidebar .widget input[type="submit"]:active {
-			background-color: ' . $accent_much_lighter . ';
+			background-color: ' . $accent_light . ';
 		}
 
 		.site-navigation .current_page_item > a,
@@ -290,7 +313,7 @@
 		.site-navigation .current_page_ancestor > a,
 		.site-navigation .current-menu-item > a,
 		.site-navigation .current-menu-ancestor > a {
-			color: ' . $accent_much_lighter . ';
+			color: ' . $accent_light . ';
 		}';
 

