Is it possible to use javascript to determine what color is one shade darker than the current background? Maybe some hexadecimal addition/subtraction?
I have a menu that can be any color and if it wasn’t too difficult it would be great if the submenu could be one shade darker. Does anyone know how to achieve this effect?
as AB comments, ‘shade’ isn’t very well defined. nonetheless, it might be easier to think of this in some other colour representation, such as ‘V’ in hsv.
you could either convert, decrease v and convert back, or figure out what decreasing v maps to in rgb hex