Use color as PHP variable
-
Hi,
I’m very happy with your plug-in. And am trying to integrate some of it’s features into a theme I’m working on.
I’m using the following script to tweak certain colors chosen in customizer: http://jaspreetchahal.org/how-to-lighten-or-darken-hex-or-rgb-color-in-php-and-javascript/My goal is to be able to pick a color for the navigation text and run that color tru this script to use a slightly darker shade as a hover effect.
This is what I use for a color scheme$color_scheme = get_theme_mod('colorpalette_scheme'); $color_scheme_darker = adjustColorLightenDarken($color_scheme,20);Where $color_scheme can be used as standard and $color_scheme_darker as a hover effect.
My question is: is it possible to output just the chosen color of an element into a PHP variable, which can then be used in the ‘adjustColorLightenDarken’ script.
As an example, here is the element I’ve added in my functions.php$options['eess_main-nav'] = array( 'name' => 'eess_main-nav', 'title' => 'Menu Text', 'description' => 'Edit your menu fonts', 'properties' => array( 'selector' => '.main-nav a' ), );Thanks in advance.
Ian
The topic ‘Use color as PHP variable’ is closed to new replies.