Answer the question
In order to leave comments, you need to log in
Is it possible to make a text button so that the color depends on the background?
Hello.
Given: a normal WP site. Some theme from the free ones, pictures are scrolled and a button is in the center. Nothing special.
Is it possible to make the color of the text (well, or the button) depend on the image? Orange picture - red button, black picture - gray button.
Answer the question
In order to leave comments, you need to log in
It is possible, but difficult.
It’s easier to get around this with a design — a backing on top of the photo so that it brightens / darkens the area under the button.
Hello.
Somehow I came across something like this , but I didn’t get my hands on how it works.
Is it possible to make the color of the text (well, or the button) depend on the image? Orange picture - red button, black picture - gray button.
How many pictures and how often should they be changed?
If there are few pictures and rarely change, then it’s easier to hardcode like
switch ($imageNum)
{
case 1:
$buttonClass = "buttonWhite";
break;
case 2:
$buttonClass = "buttonBlack";
break;
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question