3

I want to know if it is possible to change the font color/foreground color, depending on what background I have.

Let’s say I have a webpage, and the user is able to upload an image to that site, and that image will be the background image of the website.

After the user uploads the image, I want the font color to adjust for the background color, so that the font color is good and readable, depending on the background image's colors.

Let's say a user uploads an image which is mostly black. Then, the font color should be white (or some other color which is good and readable on the black background).

When the user uploads a (mostly) white image, then the font color changes to black (or another color which is good to read on a white background).

The website is written in ASP.NET.

ephaltes
  • 41
  • 1
  • 7
  • Better to use a consistent colour font but with a contrasting outline so that it's visible on all images. – DavidG Dec 04 '16 at 15:25
  • Or a translucent background. Do you want the font color to change after the picture is uploaded by the user or after the form for the picture is submitted to the server? Here is a js library that wo do that on the client side: https://github.com/lokesh/color-thief – Julian Dec 04 '16 at 18:18
  • 1
    Possible duplicate of [Black text - white when on black background](https://stackoverflow.com/questions/41042233/black-text-white-when-on-black-background) – user Aug 20 '17 at 14:36

0 Answers0