function dt_style_options_get_rgba_from_hex_color($params, $color, $opacity = 0) { $defaults = array('important' => true); $params = wp_parse_args($params, $defaults); if (is_array($color)) { $rgb_array = array_map('intval', $color); } else { $color = str_replace('#', '', $color); $rgb_array = str_split($color, 2); if (is_array($rgb_array) && count($rgb_array) == 3) { $rgb_array = array_map('hexdec', $rgb_array); } else { return 'inherit'; } } return sprintf('rgba(%d,%d,%d,%s)', $rgb_array[0], $rgb_array[1], $rgb_array[2], dt_style_options_get_opacity($opacity)); }
if (!in_array($h_icons_style, array('white', 'black'))) { $h_icons_style = 'white'; } $h_icon_url = 'url(' . get_template_directory_uri() . '/images/' . $h_icons_style . '/icons.png)'; $h_retina_icon_url = 'url(' . get_template_directory_uri() . '/images/retina/' . $h_icons_style . '/icons.png)'; $h_icons_opacity = dt_style_options_get_opacity(of_get_option('header-icons_opacity', 70)); /* * Content icons */ $c_icons_style = of_get_option('main-icons_style', 'black'); if (!in_array($c_icons_style, array('white', 'black'))) { $c_icons_style = 'black'; } $c_icon_url = 'url(' . get_template_directory_uri() . '/images/' . $c_icons_style . '/icons.png)'; $c_retina_icon_url = 'url(' . get_template_directory_uri() . '/images/retina/' . $c_icons_style . '/icons.png)'; $c_icons_opacity = dt_style_options_get_opacity(of_get_option('main-icons_opacity', 70)); ?> /* Header icons */ .contact-block span:before { background-image: <?php echo $h_icon_url; ?> ; opacity: <?php echo $h_icons_opacity; ?> ; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=<?php echo of_get_option('main-icons_opacity', 70); ?>