<?php


/** Set ABSPATH for execution */
define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
define( 'WPINC', 'wp-includes' );

/**
 * @ignore
 */
function __() {}

/**
 * @ignore
 */
function _x() {}

/**
 * @ignore
 */
function add_filter() {}

/**
 * @ignore
 */
function esc_attr($str) {return $str;}

/**
 * @ignore
 */
function apply_filters() {}

/**
 * @ignore
 */
function get_option() {}

/**
 * @ignore
 */
function is_lighttpd_before_150() {}

/**
 * @ignore
 */
function add_action() {}

/**
 * @ignore
 */
function did_action() {}

/**
 * @ignore
 */
function do_action_ref_array() {}

/**
 * @ignore
 */
function get_bloginfo() {}

/**
 * @ignore
 */
function is_admin() {return true;}

/**
 * @ignore
 */
function site_url() {}

/**
 * @ignore
 */
function admin_url() {}

/**
 * @ignore
 */
function home_url() {}

/**
 * @ignore
 */
function includes_url() {}

/**
 * @ignore
 */
function wp_guess_url() {}

if ( ! function_exists( 'json_encode' ) ) :
/**
 * @ignore
 */
function json_encode() {}
endif;



/* Convert hexdec color string to rgb(a) string */
 
function hex2rgba($color, $opacity = false) {
 
	$default = 'rgb(0,0,0)';
 
	//Return default if no color provided
	if(empty($color))
          return $default; 
 
	//Sanitize $color if "#" is provided 
        if ($color[0] == '#' ) {
        	$color = substr( $color, 1 );
        }
 
        //Check if color has 6 or 3 characters and get values
        if (strlen($color) == 6) {
                $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
        } elseif ( strlen( $color ) == 3 ) {
                $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
        } else {
                return $default;
        }
 
        //Convert hexadec to rgb
        $rgb =  array_map('hexdec', $hex);
 
        //Check if opacity is set(rgba or rgb)
        if($opacity){
        	if(abs($opacity) > 1)
        		$opacity = 1.0;
        	$output = 'rgba('.implode(",",$rgb).','.$opacity.')';
        } else {
        	$output = 'rgb('.implode(",",$rgb).')';
        }
 
        //Return rgb(a) color string
        return $output;
}

$color = 'fb724e';
if( isset($_GET['color'])) {
	$color = $_GET['color'];
}
$color = '#'.$color;
ob_start(); ?>


a , .color , .navbar .nav > li > a:hover , .navbar .nav > li.active a , .navbar .search-trigger, .navbar .navbar-toggle , .search-container .close , .feature-box .fbox-icon , .feature-list .fbox-icon , .skill .chart , .accordion-item .accordion-title a:hover , .pricing-table.pricing-highlighted li .btn , .clients .clients-content .tab-pane:before , .search-form .btn{
  color: <?php echo esc_attr(hex2rgba($color, 1)); ?>;
}

a:hover, a:active, a:focus {
	color: <?php echo esc_attr(hex2rgba($color, 0.8)); ?>; 
}

blockquote, q , .btn.btn-primary , .feature-box:hover .fbox-icon , .feature-list li:hover , .accordion-item .accordion-title a:hover , .accordion-item.active .accordion-title a , .bg-secondary .accordion-item .accordion-title a:hover  , .bg-secondary .accordion-item.active .accordion-title a , .portfolio-item .caption .icon:hover:before , #contactform .btn:hover, #contactform .btn:focus, #contactform .btn:active{
  border-color: <?php echo esc_attr(hex2rgba($color, 1)); ?>;
}

.portfolio-filters a:hover:before, .portfolio-filters a.active:before {
	border-top-color: <?php echo esc_attr(hex2rgba($color, 1)); ?>; 
}

.skill .chart{
	border-color: <?php echo esc_attr(hex2rgba($color, 0.4)); ?>;
}

.bg-primary , .video-controls.style-2 , .navbar .search-trigger:after, .navbar .navbar-toggle:after , .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-menu > li.active > a:hover, .dropdown-menu > li.active > a:focus , .btn.btn-primary , .feature-box:hover .fbox-icon  , .feature-list li:hover , .team-member:hover .caption , .facts strong i , .accordion-item.active .accordion-title a  , .bg-secondary .accordion-item .accordion-title a:hover , .bg-secondary .accordion-item.active .accordion-title a , .pricing-table.pricing-highlighted , .portfolio-filters a:hover, .portfolio-filters a.active , .portfolio-item .caption .icon:hover:before , .blog-post .post-header:after , #contactform .btn:hover, #contactform .btn:focus, #contactform .btn:active{
  background-color: <?php echo esc_attr(hex2rgba($color, 1)); ?>; 
}

<?php 

$out = ob_get_clean();
$expires_offset = 31536000; // 1 year
header('Content-Type: text/css; charset=UTF-8');
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
header('Vary: Accept-Encoding'); // Handle proxies
header('Content-Encoding: gzip');

echo gzencode($out);
exit;