Thread:Mathmagician/@comment-3508190-20120619000730/@comment-4674838-20120619002238

I'm not sure if I will be of much help here, but I can certainly make a few suggestions if you'd like. My first suggestion would be that you establish 2 separate cases:

Case A) The page background is an image -- this sounds like a tricky case to me (what is the color of an image?), so I'd like to set it aside and maybe try to address it later.

Case B) The page background is just a hex color -- which seems to be what you are considering with your test page.

My second suggestion would be to try a simple formula for determining what the text background should be. I.e. if page background isBright, then text background = page background + small numbers added to the RGB values. This should hopefully produce a color that is very close to the page background, but is still discernable. Similarly, if !isBright, then text background = page background - small numbers subtracted from the page background's RGB values. If you were trying to create a color formula, this would be what I'd try first.

What's your current formula?