WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a function, either in PHP or Wordpress itself, or in a plugin, that will choose a good css background-color to go with a given background-image?

For example, if someone chose a very large dark-brown design for a background, it should have background-color of brown so before the image loaded, or if the image failed to load, it would still look ok.

share|improve this question
Something like Color Thief (which appears to be JS-based)? – Pat J Aug 15 '14 at 14:33
@PatJ Yes, thanks, I hadn't seen that library. – NoBugs Aug 16 '14 at 1:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.