Index: wp-content/themes/twentyfourteen/inc/customizer.php
===================================================================
--- wp-content/themes/twentyfourteen/inc/customizer.php	(revision 25211)
+++ wp-content/themes/twentyfourteen/inc/customizer.php	(working copy)
@@ -16,6 +16,18 @@
 	$wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
 	$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
 
+	$wp_customize->add_setting( 'accent_color', array(
+		'default'       	=> '#24890d',
+		'sanitize_callback' => 'twentyfourteen_generate_accent_colors',
+	) );
+
+	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_color', array(
+		'label'         => __( 'Accent Color', 'twentyfourteen' ),
+		'section'       => 'colors',
+		'settings'      => 'accent_color',
+		'priority'      => 1,
+	) ) );
+
 	$wp_customize->add_section( 'twentyfourteen_theme_options', array(
 		'title'         => __( 'Theme Options', 'twentyfourteen' ),
 		'priority'      => 35,
@@ -185,3 +197,177 @@
 	wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20120827', true );
 }
 add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );
+
+/**
+ * Generates two variants of the accent color, returns the original, and saves the others as theme mods.
+ *
+ */
+function twentyfourteen_generate_accent_colors( $color ) {
+	$color = sanitize_hex_color( $color );
+	
+	set_theme_mod( 'accent_1', twentyfourteen_adjust_color( $color, 14 ) );
+	set_theme_mod( 'accent_2', twentyfourteen_adjust_color( $color, 71 ) );
+
+	return $color;
+}
+
+/**
+ * Tweaks the brightness of a color by adjusting the r/g/b values by the given interval.
+ *
+ */
+function twentyfourteen_adjust_color( $color, $steps ) {
+	// convert shorthand to full hex
+	if( strlen( $color ) == 3 ) {
+		$color = str_repeat( substr( $color, 1, 1 ), 2 ) . str_repeat( substr( $color, 2, 1 ), 2 ) . str_repeat( substr( $color, 3, 1), 2 );
+	}
+	
+	// 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
+	$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);
+	}
+	
+	return $hex;
+}
+
+/**
+ * Outputs the css for the Theme Customizer options.
+ *
+ */
+function twentyfourteen_customizer_styles() {
+	$accent_color = get_theme_mod( 'accent_color' );
+	
+	// don't do anything if the current color is the default
+	if ( $accent_color == '#24890d' )
+		return;
+		
+	$accent_1 = get_theme_mod( 'accent_1' );
+	$accent_2 = get_theme_mod( 'accent_2' );
+
+	$css = '<style type="text/css">
+		/* custom accent color */
+		h1 a:hover,
+		h2 a:hover,
+		h3 a:hover,
+		h4 a:hover,
+		h5 a:hover,
+		h6 a:hover,
+		a,
+		.primary-navigation ul ul a:hover,
+		.entry-title a:hover, 
+		.cat-links a:hover, 
+		.site-content .post-navigation a:hover, 
+		.site-content .image-navigation a:hover,
+		.comment-author a:hover,
+		.comment-metadata a:hover,
+		.comment-list .trackback a:hover,
+		.comment-list .pingback a:hover,
+		.content-sidebar a:hover,
+		.paging-navigation .page-numbers.current { 
+			color: ' . $accent_color . ';
+		}
+		
+		button:hover,
+		html input[type="button"]:hover,
+		input[type="reset"]:hover,
+		input[type="submit"]:hover,
+		button:focus,
+		html input[type="button"]:focus,
+		input[type="reset"]:focus,
+		input[type="submit"]:focus,
+		.header-extra,
+		.social-links-toggle,
+		.search-toggle,
+		.bypostauthor .avatar,
+		.widget-area button,
+		.widget-area html input[type="button"],
+		.widget-area input[type="reset"],
+		.widget-area input[type="submit"],
+		.widget_calendar a,
+		.content-sidebar button:hover,
+		.content-sidebar html input[type="button"]:hover,
+		.content-sidebar input[type="reset"]:hover,
+		.content-sidebar input[type="submit"]:hover,
+		.content-sidebar button:focus,
+		.content-sidebar html input[type="button"]:focus,
+		.content-sidebar input[type="reset"]:focus,
+		.content-sidebar input[type="submit"]:focus,
+		.page-links a:hover {
+			background-color: ' . $accent_color . ';
+		}
+		
+		::-moz-selection {
+			background: ' . $accent_color . ';
+		}
+		
+		::selection {
+			background: ' . $accent_color . ';
+		}
+		
+		.page-links a:hover,
+		.paging-navigation .page-numbers.current {
+			border-color: ' .  $accent_color . ';
+		}
+		
+		/* generated variant of custom accent color: slightly lighter */
+		.social-links-toggle:hover,
+		.search-toggle:hover,
+		.social-links-toggle.active,
+		.search-toggle.active,
+		.social-links,
+		.search-box,
+		.widget-area button:hover,
+		.widget-area html input[type="button"]:hover,
+		.widget-area input[type="reset"]:hover,
+		.widget-area input[type="submit"]:hover,
+		.widget-area button:focus,
+		.widget-area html input[type="button"]:focus,
+		.widget-area input[type="reset"]:focus,
+		.widget-area input[type="submit"]:focus,
+		.widget-area button:active,
+		.widget-area html input[type="button"]:active,
+		.widget-area input[type="reset"]:active,
+		.widget-area input[type="submit"]:active,
+		.widget_calendar a:hover {
+			background-color: ' . $accent_1 . ';
+		}
+		
+		/* generated variant of custom accent color: lighter */
+		button:active,
+		html input[type="button"]:active,
+		input[type="reset"]:active,
+		input[type="submit"]:active,
+		.content-sidebar button:active,
+		.content-sidebar html input[type="button"]:active,
+		.content-sidebar input[type="reset"]:active,
+		.content-sidebar input[type="submit"]:active {
+			background-color: ' . $accent_2 . ';
+		}
+		
+		a:hover,
+		a:focus,
+		a:active,
+		.primary-navigation li.current_page_item > a,
+		.primary-navigation li.current-menu-item > a,
+		.secondary-navigation a:hover,
+		#secondary .current_page_item > a,
+		#secondary .current-menu-item > a,
+		#featured-content .entry-meta a:hover,
+		#featured-content .entry-title a:hover,
+		#featured-content .more-link,
+		.widget-area a:hover {
+			color: ' . $accent_2 . ';
+		}
+		</style>';
+	
+	wp_add_inline_style( 'twentyfourteen-style', $css );
+}
+add_action( 'wp_enqueue_scripts', 'twentyfourteen_customizer_styles' );
\ No newline at end of file
