<?php
/**
 *  Faced Color Option
 *
 * @since Faced 1.0.0
 *
 */

/* Site Title hover color */
$wp_customize->add_setting( 'faced_options[faced-primary-color]',
    array(
        'sanitize_callback' => 'sanitize_hex_color',
        'capability'        => 'edit_theme_options',
        'transport' => 'refresh',
        'default'           => $default['faced-primary-color'],
    )
);
$wp_customize->add_control(
    new WP_Customize_Color_Control(
        $wp_customize,
        'faced_options[faced-primary-color]',
        array(
            'label'       => esc_html__( 'Site Primary Color', 'faced' ),
            'description' => esc_html__( 'It will change the color of site whole site.', 'faced' ),
            'section'     => 'colors',
             'settings'  => 'faced_options[faced-primary-color]',
        )
    )
);



/* Site Title hover color */
$wp_customize->add_setting( 'faced_options[faced-header-description-color]',
    array(
        'sanitize_callback' => 'sanitize_hex_color',
        'capability'        => 'edit_theme_options',
        'transport' => 'refresh',
        'default'           => $default['faced-header-description-color'],
    )
);
$wp_customize->add_control(
    new WP_Customize_Color_Control(
        $wp_customize,
        'faced_options[faced-header-description-color]',
        array(
            'label'       => esc_html__( 'Header Description Color', 'faced' ),
            'description' => esc_html__( 'It will change the color of site header description.', 'faced' ),
            'section'     => 'colors',
            'settings'  => 'faced_options[faced-header-description-color]',
        )
    )
);

// /*callback functions for overlay color*/
if ( !function_exists('faced_overlay_active_callback') ) :
    function faced_overlay_active_callback(){
        global $faced_theme_options;
        $faced_theme_options = faced_get_options_value();
        $enable_slider = absint($faced_theme_options['faced-enable-slider']);
        $enable_category_boxes = absint($faced_theme_options['faced-enable-category-boxes']);
        if($enable_slider || $enable_category_boxes ){
            return true;
        }
        else{
            return false;
        }
    }
  endif;

//Color option for slider hex color
$wp_customize->add_setting( 'faced_options[faced-overlay-color]' , array(
    'default'           => $default['faced-overlay-color'], // Use any HEX or RGBA value.
    'transport'         => 'refresh',
    'sanitize_callback' => 'faced_alpha_color_sanitization_callback'
) );
include_once get_theme_file_path( 'candidthemes/alpha-color/src/ColorAlpha.php' );

$wp_customize->add_control( new ColorAlpha( $wp_customize, 'faced_options[faced-overlay-color]', [
    'label'      => __( 'Overlay First Color', 'faced' ),
    'description' => esc_html__( 'It will change the overlay color of slider and category box sections.', 'faced' ),
    'section'    => 'colors',
    'settings'   => 'faced_options[faced-overlay-color]',
    'active_callback'=>'faced_overlay_active_callback',
] ) );


$wp_customize->add_setting( 'faced_options[faced-overlay-second-color]' , array(
    'default'           => $default['faced-overlay-second-color'], // Use any HEX or RGBA value.
    'transport'         => 'refresh',
    'sanitize_callback' => 'faced_alpha_color_sanitization_callback'
) );

$wp_customize->add_control( new ColorAlpha( $wp_customize, 'faced_options[faced-overlay-second-color]', [
    'label'      => __( 'Overlay Second Color', 'faced' ),
    'description' => esc_html__( 'It will change the overlay color of slider and category box sections.', 'faced' ),
    'section'    => 'colors',
    'settings'   => 'faced_options[faced-overlay-second-color]',
    'active_callback'=>'faced_overlay_active_callback',
] ) );
