WordPress.org

Support

Support » Plugins and Hacks » Supersized full screen background – change font color for different background

Supersized full screen background – change font color for different background

  • Hello everybody,

    I have installed the supersized full screen background plugin. I like it very much, but sometimes the background is very light and my text is white, so I cannot read the text (and vice versa). Does anybody know a way to change the font color for each background image???

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • If fount a bit of code on how to measure the brightness of the background and how to give back a light or dark tag, does anybody have any idea how to use this for what I want????

    var darkOrLight = function(red, green, blue) {
      var brightness;
      brightness = (red * 299) + (green * 587) + (blue * 114);
      brightness = brightness / 255000;
    
      // values range from 0 to 1
      // anything greater than 0.5 should be bright enough for dark text
      if (brightness >= 0.5) {
        return "dark";
      } else {
        return "light";
      }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Supersized full screen background – change font color for different background’ is closed to new replies.