Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.