本文整理汇总了PHP中td_util::hex2rgba方法的典型用法代码示例。如果您正苦于以下问题:PHP td_util::hex2rgba方法的具体用法?PHP td_util::hex2rgba怎么用?PHP td_util::hex2rgba使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类td_util
的用法示例。
在下文中一共展示了td_util::hex2rgba方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: td_css_generator
function td_css_generator()
{
$raw_css = "\n <style>\n\n /* @theme_color */\n .block-title a, .block-title span, .td-tags a:hover, .td-scroll-up-visible, .td-scroll-up, .sf-menu ul\n .current-menu-item > a, .sf-menu ul a:hover, .sf-menu ul .sfHover > a, .sf-men ... //#注:代码行过长, 已省略后续字符...
$td_css_compiler = new td_css_compiler($raw_css);
//the template directory uri
$td_css_compiler->load_setting_raw('get_template_directory_uri', get_template_directory_uri());
//add the typography css to the theme generated css
foreach (td_fonts::$typography_sections as $section_id => $section_name) {
if (!empty(td_global::$td_options['td_fonts'][$section_id])) {
$section_css_array = td_global::$td_options['td_fonts'][$section_id];
if (!empty($section_css_array['font_family'])) {
$section_css_array = td_fonts::css_get_font_family(td_global::$td_options['td_fonts'][$section_id]);
}
//check if we have font_family in the array
if (!empty($section_css_array)) {
$td_css_compiler->load_setting_array(array($section_id => $section_css_array));
}
}
}
//load the user settings
$td_css_compiler->load_setting('theme_color');
$td_css_compiler->load_setting('header_wrap_color');
$td_css_compiler->load_setting('menu_color');
//header background color
$td_css_compiler->load_setting('menu_text_color');
$td_css_compiler->load_setting('top_menu_color');
$td_css_compiler->load_setting('logo_text_color');
$td_css_compiler->load_setting('link_color');
$td_css_compiler->load_setting('link_hover_color');
$td_css_compiler->load_setting('small_text_slide');
$td_css_compiler->load_setting('header_align_top');
$td_css_compiler->load_setting('transparent_header');
$td_css_compiler->load_setting('footer_color');
$td_css_compiler->load_setting('footer_bottom_color');
$td_css_compiler->load_setting('footer_text_color');
$td_css_compiler->load_setting('footer_bottom_text_color');
$td_css_compiler->load_setting('menu_icon_color');
$td_css_compiler->load_setting('big_slide_transform');
$td_css_compiler->load_setting('main_menu_transform');
//top menu + line color
$tds_top_menu_text_color = td_util::get_option('td_fonts');
if (!empty($tds_top_menu_text_color['top_menu']['color'])) {
$td_css_compiler->load_setting_raw('top_menu_line', td_util::hex2rgba($tds_top_menu_text_color['top_menu']['color'], 0.3));
}
//footer menu + line color
$td_css_compiler->load_setting('footer_bottom_text_color');
$tds_footer_bottom_text_color = td_util::get_option('tds_footer_bottom_text_color');
if (!empty($tds_footer_bottom_text_color)) {
$td_css_compiler->load_setting_raw('footer_bottom_line', td_util::hex2rgba($tds_footer_bottom_text_color, 0.3));
}
//load the selection color
$tds_theme_color = td_util::get_option('tds_theme_color');
if (!empty($tds_theme_color)) {
//the select
$td_css_compiler->load_setting_raw('select_color', td_util::adjustBrightness($tds_theme_color, 50));
//the sliders text
$td_css_compiler->load_setting_raw('slider_text', td_util::hex2rgba($tds_theme_color, 0.7));
}
//add fonts css buffer
$td_fonts_css_buffer = td_util::get_option('td_fonts_css_buffer');
if (!empty($td_fonts_css_buffer)) {
td_css_buffer::add($td_fonts_css_buffer);
}
//output the style
td_css_buffer::add($td_css_compiler->compile_css());
}
示例2: td_css_generator
/**
* @big_grid_large_image is put after @big_grid_small_images so that it will overwrite small posts style
*/
function td_css_generator()
{
$raw_css = "\r\n <style>\r\n /* ------------------------------------------------------ */\r\n /* Newspaper 6 */\r\n\r\n /* ------------------------------------------------------ */\r\n /* GENERAL Theme Colors */\r\n\r\n /* TH ... //#注:代码行过长, 已省略后续字符...
$td_css_compiler = new td_css_compiler($raw_css);
//the template directory uri
$td_css_compiler->load_setting_raw('get_template_directory_uri', get_template_directory_uri());
//get $typography array from db and added to generated css
$td_typography_array = td_fonts::td_get_typography_sections_from_db();
if (is_array($td_typography_array) and !empty($td_typography_array)) {
foreach ($td_typography_array as $section_id => $section_css_array) {
$td_css_compiler->load_setting_array(array($section_id => $section_css_array));
}
}
// read line-height for the main-menu to align the logo in menu // nu e folosit
$td_menu_height = td_util::get_option('td_fonts');
if (!empty($td_menu_height['main_menu']['line_height'])) {
$td_css_compiler->load_setting_raw('main-menu-height', $td_menu_height['main_menu']['line_height']);
}
// read line-height for the top-menu to align the social icons in top menu
$td_top_menu_height = td_util::get_option('td_fonts');
if (!empty($td_top_menu_height['top_menu']['line_height'])) {
$td_css_compiler->load_setting_raw('top-menu-height', $td_top_menu_height['top_menu']['line_height']);
}
// footer background
$td_css_compiler->load_setting('footer_background_image');
$td_css_compiler->load_setting('footer_background_repeat');
$td_css_compiler->load_setting('footer_background_size');
$td_css_compiler->load_setting('footer_background_position');
$td_css_compiler->load_setting('footer_background_opacity');
//load the user settings
// general
$td_css_compiler->load_setting('theme_color');
$td_css_compiler->load_setting('header_color');
$td_css_compiler->load_setting('text_header_color');
// header ---------
$td_css_compiler->load_setting('top_menu_color');
$td_css_compiler->load_setting('top_menu_text_color');
$td_css_compiler->load_setting('top_menu_text_hover_color');
$td_css_compiler->load_setting('top_social_icons_color');
$td_css_compiler->load_setting('top_social_icons_hover_color');
$td_css_compiler->load_setting('menu_color');
$td_css_compiler->load_setting('submenu_hover_color');
$td_css_compiler->load_setting('menu_text_color');
$td_css_compiler->load_setting('header_wrap_color');
$td_css_compiler->load_setting('mobile_menu_color');
$td_css_compiler->load_setting('mobile_icons_color');
$td_css_compiler->load_setting('open_background_color');
$td_css_compiler->load_setting('open_border_color');
$td_css_compiler->load_setting('open_text_color');
$td_css_compiler->load_setting('open_text_hover_color');
// footer ---------
$td_css_compiler->load_setting('footer_color');
$td_css_compiler->load_setting('footer_text_color');
$td_css_compiler->load_setting('footer_bottom_color');
$td_css_compiler->load_setting('footer_bottom_text_color');
$td_css_compiler->load_setting('footer_bottom_hover_color');
// posts ---------
$td_css_compiler->load_setting('post_title_color');
$td_css_compiler->load_setting('post_author_name_color');
$td_css_compiler->load_setting('post_content_color');
$td_css_compiler->load_setting('post_h_color');
$td_css_compiler->load_setting('post_blockquote_color');
// pages ---------
$td_css_compiler->load_setting('page_title_color');
$td_css_compiler->load_setting('page_content_color');
$td_css_compiler->load_setting('page_h_color');
//load the selection color
$tds_theme_color = td_util::get_option('tds_theme_color');
if (!empty($tds_theme_color)) {
//the select
$td_css_compiler->load_setting_raw('select_color', td_util::adjustBrightness($tds_theme_color, 50));
//the sliders text
$td_css_compiler->load_setting_raw('slider_text', td_util::hex2rgba($tds_theme_color, 0.7));
}
/**
* add td_fonts_css_buffer from database into the source of the page
*
* td_fonts_css_buffer : used to store the css generated for custom font files in the database
*/
$td_fonts_css_buffer = td_fonts::td_add_fonts_css_buffer();
/* add block styles */
$td_block_styles = td_util::get_option('td_block_styles');
//check if we have something set by the user
if (!empty($td_block_styles)) {
foreach ($td_block_styles as $style_name => $array_style_options) {
foreach ($array_style_options as $option_key => $option_val) {
if (!empty($td_block_styles[$style_name][$option_key])) {
$option_name_generator = str_replace('tds_', $style_name . '_', $option_key);
switch ($option_key) {
case 'tds_block_drop_down_background_color':
$td_css_compiler->load_setting_raw($option_name_generator, td_util::hex2rgba($td_block_styles[$style_name][$option_key], 0.95));
$td_css_compiler->load_setting_raw($option_name_generator . '_ie8', $td_block_styles[$style_name][$option_key]);
break;
case 'tds_block_module_post_comments_box_background_color':
$td_css_compiler->load_setting_raw($option_name_generator, $td_block_styles[$style_name][$option_key]);
//converting hex color to rgb
$rgb_color = td_util::html2rgb($td_block_styles[$style_name][$option_key]);
//.........这里部分代码省略.........
示例3: td_css_generator
/**
* @big_grid_large_image is put after @big_grid_small_images so that it will overwrite small posts style
*/
function td_css_generator()
{
$raw_css = "\n <style>\n\n /* @theme_color */\n .td-header-border:before,\n .td-trending-now-title,\n .td_mega_menu .td_mega_menu_sub_cats .cur-sub-cat,\n .td-post-category:hover,\n .td-header-style-2 .td-header-sp-logo,\n ... //#注:代码行过长, 已省略后续字符...
$td_css_compiler = new td_css_compiler($raw_css);
//the template directory uri
$td_css_compiler->load_setting_raw('get_template_directory_uri', get_template_directory_uri());
//get $typography array from db and added to generated css
$td_typography_array = td_fonts::td_get_typography_sections_from_db();
if (is_array($td_typography_array) and !empty($td_typography_array)) {
foreach ($td_typography_array as $section_id => $section_css_array) {
$td_css_compiler->load_setting_array(array($section_id => $section_css_array));
}
}
// read line-height for the main-menu to align the logo in menu
$td_menu_height = td_util::get_option('td_fonts');
if (!empty($td_menu_height['main_menu']['line_height'])) {
$td_css_compiler->load_setting_raw('main-menu-height', $td_menu_height['main_menu']['line_height']);
}
//load the user settings
// general
$td_css_compiler->load_setting('theme_color');
$td_css_compiler->load_setting('grid_line_color');
// header ---------
$td_css_compiler->load_setting('top_menu_color');
$td_css_compiler->load_setting('top_menu_text_color');
$td_css_compiler->load_setting('top_menu_text_hover_color');
$td_css_compiler->load_setting('top_sub_menu_text_color');
$td_css_compiler->load_setting('top_sub_menu_text_hover_color');
$td_css_compiler->load_setting('top_social_icons_color');
$td_css_compiler->load_setting('top_social_icons_hover_color');
$td_css_compiler->load_setting('menu_color');
$td_css_compiler->load_setting('menu_text_color');
$td_css_compiler->load_setting('menu_border_color');
$td_css_compiler->load_setting('header_wrap_color');
// footer ---------
$td_css_compiler->load_setting('footer_color');
$td_css_compiler->load_setting('footer_bottom_color');
$td_css_compiler->load_setting('footer_bottom_text_color');
// posts
$td_css_compiler->load_setting('post_title_color');
$td_css_compiler->load_setting('post_author_name_color');
$td_css_compiler->load_setting('post_content_color');
$td_css_compiler->load_setting('post_h_color');
$td_css_compiler->load_setting('post_blockquote_color');
// pages
$td_css_compiler->load_setting('page_title_color');
$td_css_compiler->load_setting('page_content_color');
$td_css_compiler->load_setting('page_h_color');
// modules and blocks
$td_css_compiler->load_setting('module1_title_color');
$td_css_compiler->load_setting('module2_title_color');
$td_css_compiler->load_setting('module3_title_color');
$td_css_compiler->load_setting('module4_title_color');
$td_css_compiler->load_setting('module5_title_color');
$td_css_compiler->load_setting('module6_title_color');
$td_css_compiler->load_setting('module7_title_color');
$td_css_compiler->load_setting('module8_title_color');
$td_css_compiler->load_setting('module9_title_color');
$td_css_compiler->load_setting('module10_title_color');
$td_css_compiler->load_setting('module11_title_color');
$td_css_compiler->load_setting('module12_title_color');
$td_css_compiler->load_setting('module13_title_color');
$td_css_compiler->load_setting('module14_title_color');
$td_css_compiler->load_setting('module15_title_color');
$td_css_compiler->load_setting('module_mx2_title_color');
$td_css_compiler->load_setting('module_mx4_title_color');
$td_css_compiler->load_setting('news_ticker_title_color');
$td_css_compiler->load_setting('author_name_title_color');
//load the selection color
$tds_theme_color = td_util::get_option('tds_theme_color');
if (!empty($tds_theme_color)) {
//the select
$td_css_compiler->load_setting_raw('select_color', td_util::adjustBrightness($tds_theme_color, 50));
//the sliders text
$td_css_compiler->load_setting_raw('slider_text', td_util::hex2rgba($tds_theme_color, 0.7));
}
/**
* add td_fonts_css_buffer from database into the source of the page
*
* td_fonts_css_buffer : used to store the css generated for custom font files in the database
*/
$td_fonts_css_buffer = td_fonts::td_add_fonts_css_buffer();
/* add block styles */
$td_block_styles = td_util::get_option('td_block_styles');
//check if we have something set by the user
if (!empty($td_block_styles)) {
foreach ($td_block_styles as $style_name => $array_style_options) {
foreach ($array_style_options as $option_key => $option_val) {
if (!empty($td_block_styles[$style_name][$option_key])) {
$option_name_generator = str_replace('tds_', $style_name . '_', $option_key);
switch ($option_key) {
case 'tds_block_drop_down_background_color':
$td_css_compiler->load_setting_raw($option_name_generator, td_util::hex2rgba($td_block_styles[$style_name][$option_key], 0.95));
$td_css_compiler->load_setting_raw($option_name_generator . '_ie8', $td_block_styles[$style_name][$option_key]);
break;
case 'tds_block_module_post_comments_box_background_color':
$td_css_compiler->load_setting_raw($option_name_generator, $td_block_styles[$style_name][$option_key]);
//.........这里部分代码省略.........