<?php
/**
 * WordPress.com-specific functions and definitions
 * This file is centrally included from `wp-content/mu-plugins/wpcom-theme-compat.php`.
 *
 * @package Comet
 * @since Comet 1.0
 */

/**
 * Adds support for wp.com-specific theme functions
 */
function comet_add_wpcom_support() {
	global $themecolors;

	// Set a default theme color array.
	$comet_options = comet_get_theme_options();

	switch ( $comet_options['color_scheme'] ) {
		case 'blue' :
			$themecolors = array(
				'bg'     => 'f2f3f4',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'c9d1dc',
				'url'    => 'b91313',
			);
			break;
		case 'green' :
			$themecolors = array(
				'bg'     => 'f2f4f2',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'cdd8cd',
				'url'    => 'b91313',
			);
			break;
		case 'purple' :
			$themecolors = array(
				'bg'     => 'f3f2f4',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'd3c8dd',
				'url'    => 'b91313',
			);
			break;
		case 'red' :
			$themecolors = array(
				'bg'     => 'e7e4e4',
				'text'   => '888888',
				'link'   => '2464b3',
				'border' => 'e6bfbf',
				'url'    => '2464b3',
			);
			break;
		case 'teal' :
			$themecolors = array(
				'bg'     => 'f2f4f4',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'c8dddd',
				'url'    => 'b91313',
			);
			break;
		case 'yellow' :
			$themecolors = array(
				'bg'     => 'f4f3f2',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'e7dbbe',
				'url'    => 'b91313',
			);
			break;
		case 'grey' :
		default :
			$themecolors = array(
				'bg'     => 'f3f3f3',
				'text'   => '888888',
				'link'   => 'b91313',
				'border' => 'd2d2d2',
				'url'    => 'b91313',
			);
			break;
	}
}
add_action( 'after_setup_theme', 'comet_add_wpcom_support' );

//WordPress.com specific styles
function comet_wpcom_styles() {
	wp_enqueue_style( 'comet-wpcom', get_template_directory_uri() . '/inc/style-wpcom.css', '20130005' );
}
add_action( 'wp_enqueue_scripts', 'comet_wpcom_styles' );