<?php if(!function_exists('hubsteel_configs')){
    function hubsteel_configs($value){
        $configs = [
            'theme_colors' => [
                'primary'   => [
                    'title' => esc_html__('Primary', 'hubsteel'), 
                    'value' => hubsteel()->get_opt('primary_color', '#ed5518')
                ],
                'secondary'   => [
                    'title' => esc_html__('Secondary', 'hubsteel'), 
                    'value' => hubsteel()->get_opt('secondary_color', '#666666')
                ],
                'third'   => [
                    'title' => esc_html__('Third', 'hubsteel'), 
                    'value' => hubsteel()->get_opt('third_color', '#666666')
                ],
                'dark'   => [
                    'title' => esc_html__('Dark', 'hubsteel'), 
                    'value' => hubsteel()->get_opt('dark_color', '#666666')
                ],
                'body-bg'   => [
                    'title' => esc_html__('Body Background Color', 'hubsteel'), 
                    'value' => hubsteel()->get_page_opt('body_bg_color', '#fff')
                ]
            ],
            'link' => [
                'color' => hubsteel()->get_opt('link_color', ['regular' => '#0d0d0d'])['regular'],
                'color-hover'   => hubsteel()->get_opt('link_color', ['hover' => '#ed5518'])['hover'],
                'color-active'  => hubsteel()->get_opt('link_color', ['active' => '#ed5518'])['active'],
            ],
            'gradient' => [
                'color-from' => hubsteel()->get_opt('gradient_color', ['from' => '#fff'])['from'],
                'color-to' => hubsteel()->get_opt('gradient_color', ['to' => '#ed5518'])['to'],
            ],
               
        ];
        return $configs[$value];
    }
}
if(!function_exists('hubsteel_inline_styles')) {
    function hubsteel_inline_styles() {  
        
        $theme_colors      = hubsteel_configs('theme_colors');
        $link_color        = hubsteel_configs('link');
        $gradient_color    = hubsteel_configs('gradient');
        ob_start();
        echo ':root{';
            
            foreach ($theme_colors as $color => $value) {
                printf('--%1$s-color: %2$s;', str_replace('#', '',$color),  $value['value']);
            }
            foreach ($theme_colors as $color => $value) {
                printf('--%1$s-color-rgb: %2$s;', str_replace('#', '',$color),  hubsteel_hex_rgb($value['value']));
            }
            foreach ($link_color as $color => $value) {
                printf('--link-%1$s: %2$s;', $color, $value);
            }
            foreach ($gradient_color as $color => $value) {
                printf('--gradient-%1$s: %2$s;', $color, $value);
            }
        echo '}';

        return ob_get_clean();
         
    }
}
 