0

I have an audio player with a 00:00 navigation pattern situated above the music album cover.

navigation numbers

My question is how to make these navigation numbers white when the album cover is black and black, while the cover is white. How can I make such a thing on vanilla javascript? Should it be a function to analyze an image's pixel color?

WizardRew
  • 27
  • 7
  • https://stackoverflow.com/questions/16981763/invert-css-font-color-depending-on-background-color – epascarello Nov 05 '20 at 14:23
  • Thx, but this link is not exactly what I am looking for - my background, not a color, but a picture, so the problem is - color-switching depending on background picture color. – WizardRew Nov 05 '20 at 14:39
  • 1
    Since it sounds as though you might be getting dark background, or light or a mixture would it be better, to ensure the user can always see the numbers, to just give them a black background and have them white regardless of what they are on top of? – A Haworth Nov 05 '20 at 17:04
  • @A Haworth yes, but unfortunately, I need all navigation tools above the album cover, so these numbers must switch their colors. – WizardRew Nov 06 '20 at 09:34
  • You can give a fixed background color just to the numbers (not the background cover). – Praneet Dixit Dec 15 '20 at 03:44

0 Answers0