array(
'label' => __( 'Default', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#f1f1f1',
'#ffffff',
'#ffffff',
'#333333',
'#333333',
'#f7f7f7',
),
),
'dark' => array(
'label' => __( 'Dark', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#111111',
'#202020',
'#202020',
'#bebebe',
'#bebebe',
'#1b1b1b',
),
),
'yellow' => array(
'label' => __( 'Yellow', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#f4ca16',
'#ffdf00',
'#ffffff',
'#111111',
'#111111',
'#f1f1f1',
),
),
'pink' => array(
'label' => __( 'Pink', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#ffe5d1',
'#e53b51',
'#ffffff',
'#352712',
'#ffffff',
'#f1f1f1',
),
),
'purple' => array(
'label' => __( 'Purple', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#674970',
'#2e2256',
'#ffffff',
'#2e2256',
'#ffffff',
'#f1f1f1',
),
),
'blue' => array(
'label' => __( 'Blue', 'amp-accelerated-mobile-pages' ),
'colors' => array(
'#e9f2f9',
'#55c3dc',
'#ffffff',
'#22313f',
'#ffffff',
'#f1f1f1',
),
),
) );
}
if ( ! function_exists( 'etruel_amp_theme_get_color_scheme' ) ) :
/**
* Get the current AMP color scheme.
* @since 0.1.1
* @return array An associative array of either the current or default color scheme hex values.
*/
function etruel_amp_theme_get_color_scheme() {
$color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
$color_schemes = etruel_amp_theme_get_color_schemes();
if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
return $color_schemes[ $color_scheme_option ]['colors'];
}
return $color_schemes['default']['colors'];
}
endif; // etruel_amp_theme_get_color_scheme
if ( ! function_exists( 'etruel_amp_theme_header_style' ) ) :
/**
* Styles the header image on the blog.
* @since 0.1.1
*/
function etruel_amp_theme_header_style() {
$header_image = get_header_image();
$header_text_color = get_header_textcolor();
?>
';
}
return;
}
$style = $color ? "background-color: #$color;" : '';
if ( $background ) {
$image = ' background-image: url("' . esc_url_raw( $background ) . '");';
// Background Position.
$position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
$position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
if ( ! in_array( $position_x, array( 'left', 'center', 'right' ), true ) ) {
$position_x = 'left';
}
if ( ! in_array( $position_y, array( 'top', 'center', 'bottom' ), true ) ) {
$position_y = 'top';
}
$position = " background-position: $position_x $position_y;";
// Background Size.
$size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
if ( ! in_array( $size, array( 'auto', 'contain', 'cover' ), true ) ) {
$size = 'auto';
}
$size = " background-size: $size;";
// Background Repeat.
$repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
if ( ! in_array( $repeat, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ), true ) ) {
$repeat = 'repeat';
}
$repeat = " background-repeat: $repeat;";
// Background Scroll.
$attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
if ( 'fixed' !== $attachment ) {
$attachment = 'scroll';
}
$attachment = " background-attachment: $attachment;";
$style .= $image . $position . $size . $repeat . $attachment;
} ?>