当前位置: 首页>>代码示例>>PHP>>正文


PHP wc_light_or_dark函数代码示例

本文整理汇总了PHP中wc_light_or_dark函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_light_or_dark函数的具体用法?PHP wc_light_or_dark怎么用?PHP wc_light_or_dark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wc_light_or_dark函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: woocommerce_light_or_dark

 /**
  * @deprecated
  */
 function woocommerce_light_or_dark($color, $dark = '#000000', $light = '#FFFFFF')
 {
     return wc_light_or_dark($color, $dark, $light);
 }
开发者ID:nayemDevs,项目名称:woocommerce,代码行数:7,代码来源:wc-deprecated-functions.php

示例2: get_option

 * the readme will list any important changes.
 *
 * @see 	    https://docs.woothemes.com/document/template-structure/
 * @author  WooThemes
 * @package WooCommerce/Templates/Emails
 * @version 2.3.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
// Load colours
$bg = get_option('woocommerce_email_background_color');
$body = get_option('woocommerce_email_body_background_color');
$base = get_option('woocommerce_email_base_color');
$base_text = wc_light_or_dark($base, '#202020', '#ffffff');
$text = get_option('woocommerce_email_text_color');
$bg_darker_10 = wc_hex_darker($bg, 10);
$body_darker_10 = wc_hex_darker($body, 10);
$base_lighter_20 = wc_hex_lighter($base, 20);
$base_lighter_40 = wc_hex_lighter($base, 40);
$text_lighter_20 = wc_hex_lighter($text, 20);
// !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
?>
#wrapper {
    background-color: <?php 
echo esc_attr($bg);
?>
;
    margin: 0;
    padding: 70px 0 70px 0;
开发者ID:coderkevin,项目名称:woocommerce,代码行数:31,代码来源:email-styles.php

示例3: woocommerce_compile_less_styles

/**
 * Generate CSS from the less file when changing colours.
 *
 * @access public
 * @return void
 */
function woocommerce_compile_less_styles()
{
    global $woocommerce;
    $colors = array_map('esc_attr', (array) get_option('woocommerce_frontend_css_colors'));
    $base_file = WC()->plugin_path() . '/assets/css/woocommerce-base.less';
    $less_file = WC()->plugin_path() . '/assets/css/woocommerce.less';
    $css_file = WC()->plugin_path() . '/assets/css/woocommerce.css';
    // Write less file
    if (is_writable($base_file) && is_writable($css_file)) {
        // Colours changed - recompile less
        if (!class_exists('lessc')) {
            include_once WC()->plugin_path() . '/includes/libraries/class-lessc.php';
        }
        if (!class_exists('cssmin')) {
            include_once WC()->plugin_path() . '/includes/libraries/class-cssmin.php';
        }
        try {
            // Set default if colours not set
            if (!$colors['primary']) {
                $colors['primary'] = '#ad74a2';
            }
            if (!$colors['secondary']) {
                $colors['secondary'] = '#f7f6f7';
            }
            if (!$colors['highlight']) {
                $colors['highlight'] = '#85ad74';
            }
            if (!$colors['content_bg']) {
                $colors['content_bg'] = '#ffffff';
            }
            if (!$colors['subtext']) {
                $colors['subtext'] = '#777777';
            }
            // Write new color to base file
            $color_rules = "\n@primary:       " . $colors['primary'] . ";\n@primarytext:   " . wc_light_or_dark($colors['primary'], 'desaturate(darken(@primary,50%),18%)', 'desaturate(lighten(@primary,50%),18%)') . ";\n\n@secondary:     " . $colors['secondary'] . ";\n@secondarytext: " . wc_light_or_dark($colors['secondary'], 'desaturate(darken(@secondary,60%),18%)', 'desaturate(lighten(@secondary,60%),18%)') . ";\n\n@highlight:     " . $colors['highlight'] . ";\n@highlightext:  " . wc_light_or_dark($colors['highlight'], 'desaturate(darken(@highlight,60%),18%)', 'desaturate(lighten(@highlight,60%),18%)') . ";\n\n@contentbg:     " . $colors['content_bg'] . ";\n\n@subtext:       " . $colors['subtext'] . ";\n            ";
            file_put_contents($base_file, $color_rules);
            $less = new lessc($less_file);
            $compiled_css = $less->parse();
            $compiled_css = CssMin::minify($compiled_css);
            if ($compiled_css) {
                file_put_contents($css_file, $compiled_css);
            }
        } catch (exception $ex) {
            wp_die(__('Could not compile woocommerce.less:', 'woocommerce') . ' ' . $ex->getMessage());
        }
    }
}
开发者ID:hoonio,项目名称:PhoneAfrika,代码行数:53,代码来源:wc-admin-functions.php

示例4: test_wc_light_or_dark

 /**
  * Test wc_light_or_dark().
  *
  * @since 2.2
  */
 public function test_wc_light_or_dark()
 {
     $this->assertEquals('#FFFFFF', wc_light_or_dark('005dab'));
     $this->assertEquals('#FFFFFF', wc_light_or_dark('#005dab'));
 }
开发者ID:jimlove7273,项目名称:woocommerce,代码行数:10,代码来源:functions.php

示例5: get_option

//red";
$order_items_table_outer_border_radius = $order_items_table_outer_border_style != 'none' ? get_option("ec_deluxe_all_order_item_table_radius") : '0';
//3px
$order_items_table_inner_border_width = 1;
//px
$order_items_table_inner_border_style = get_option("ec_deluxe_all_border_style");
//"dotted";
$order_items_table_inner_border_color = get_option("ec_deluxe_all_border_color");
//"#d4d4d4";
$order_items_table_header_bg_color = "none";
$order_items_table_td_padding = 9;
//px
//Footer Styling
$footer_bg_color = $top_nav_bg_color;
// get_option( "ec_deluxe_all_footer_color" ); // "#F9F9F5";
$footer_text_color = wc_light_or_dark($footer_bg_color, wc_hex_darker($footer_bg_color, 60), wc_hex_lighter($footer_bg_color, 60));
$footer_border_bottom_color = wc_hex_darker($footer_bg_color, 5);
$footer_a_color = "#3C3C3C";
$footer_a_decoration = "none";
$footer_a_style = "none";
/* Style
---------------------------------------- */
ob_start();
?>
<style>

/* Main Styles
---------------------------------------- */
body { margin: 0; padding: 0; font-family: Arial, sans-serif; line-height: <?php 
echo $body_line_height;
?>
开发者ID:seoduda,项目名称:Patua,代码行数:31,代码来源:email-header-deluxe.php

示例6: get_option

/**
 * Email Styles
 *
 * @author  WooThemes
 * @package WooCommerce/Templates/Emails
 * @version 2.3.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
// Load colours
$bg = get_option('woocommerce_email_background_color');
$body = get_option('woocommerce_email_body_background_color');
$base = get_option('woocommerce_email_base_color');
$base_text = wc_light_or_dark($base, '#FFFFFF', '#ffffff');
$text = get_option('woocommerce_email_text_color');
$bg_darker_10 = wc_hex_darker($bg, 10);
$body_darker_10 = wc_hex_darker($body, 10);
$base_lighter_20 = wc_hex_lighter($base, 20);
$base_lighter_40 = wc_hex_lighter($base, 40);
$text_lighter_20 = wc_hex_lighter($text, 20);
// !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
?>
#wrapper {
    background-color: <?php 
echo esc_attr($bg);
?>
;
    margin: 0;
    padding: 70px 0 70px 0;
开发者ID:srwonka,项目名称:git-paneladopet,代码行数:31,代码来源:email-styles.php

示例7: wc_light_or_dark

?>
;
$secondary:     <?php 
echo $colors['secondary'];
?>
;
$secondarytext: <?php 
echo wc_light_or_dark($colors['secondary'], 'desaturate(darken($secondary,60%),18%)', 'desaturate(lighten($secondary,60%),18%)');
?>
;
$highlight:     <?php 
echo $colors['highlight'];
?>
;
$highlightext:  <?php 
echo wc_light_or_dark($colors['highlight'], 'desaturate(darken($highlight,60%),18%)', 'desaturate(lighten($highlight,60%),18%)');
?>
;
$contentbg:     <?php 
echo $colors['content_bg'];
?>
;
$subtext:       <?php 
echo $colors['subtext'];
?>
;

p.demo_store {
	background-color: $primary;
	color: $primarytext;
}
开发者ID:quinntron,项目名称:greendot,代码行数:31,代码来源:scss.php


注:本文中的wc_light_or_dark函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。