DEV Community

Discussion on: Write a function that outputs a pleasant text color hex given a background color hex

Collapse
 
ben profile image
Ben Halpern

So this returns black or white, but what if the ideal solution returned, perhaps a very dark version of the background color. Like, dark blue on light blue might be more pleasant than black on light blue etc.

Collapse
 
nektro profile image
Meghan (she/her)

Would this work then? get color, convert color to HSL, return L - 100 % 100