Skip to content

Commit

Permalink
Cleaning up lib/output.php #44
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Mancke committed May 24, 2016
1 parent 490ce18 commit 3f2417b
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions lib/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,6 @@ function genesis_sample_color_brightness( $color, $change ) {

}

//* Change Color Brightness
function genesis_sample_change_brightness( $color ) {

$hexcolor = str_replace( '#', '', $color );

$red = hexdec( substr( $hexcolor, 0, 2 ) );
$green = hexdec( substr( $hexcolor, 2, 2 ) );
$blue = hexdec( substr( $hexcolor, 4, 2 ) );

$luminosity = ( ( $red * 0.2126 ) + ( $green * 0.7152 ) + ( $blue * 0.0722 ) );

return ( $luminosity > 128 ) ? genesis_sample_color_brightness( '#333333', 20 ) : genesis_sample_color_brightness( '#ffffff', -50 );

}

$css .= ( genesis_sample_customizer_get_default_link_color() !== $color_link ) ? sprintf( '
a,
Expand All @@ -85,7 +70,7 @@ function genesis_sample_change_brightness( $color ) {
.genesis-nav-menu .sub-menu .current-menu-item > a:hover,
.js nav button:focus,
.js .menu-toggle:focus {
color: %1$s;
color: %s;
}
', $color_link ) : '';

Expand All @@ -105,13 +90,13 @@ function genesis_sample_change_brightness( $color ) {
.button:focus,
.button:hover,
.sidebar .enews-widget input[type="submit"] {
background-color: %1$s;
color: %2$s;
background-color: %s;
color: %s;
}
', $color_accent, genesis_sample_color_contrast( $color_accent ), genesis_sample_change_brightness( $color_accent ) ) : '';
', $color_accent, genesis_sample_color_contrast( $color_accent ) ) : '';

if ( $css ) {
wp_add_inline_style( $handle, $css );
}

}
}

0 comments on commit 3f2417b

Please sign in to comment.