Is it possible to calculate / determine if a HEX/RGB/RGBA color is a dark color or not?I store colors for some items in my table and when I represent the color in the list, I'd need to calculate this so I could set text-color to #FFFFFF if the color is darker, or to set #000000 if it's brighter.Is this possible to achive with JavaScript, or on server-side with PHP?