Comment by johnisgood
Comment by johnisgood a day ago
So 0.5 is correct after all?! I thought I was completely off with 0.5 and I thought it does not align with human perception because I thought I was wrong. Ouch. In my defense, it has been a while. :D
BTW, would this relatively simple way to determine if the color is dark work?
$luminance = 0.299 * $r + 0.587 * $g + 0.114 * $b;
return $luminance < $threshold;
Where $threshold is 128, I think? IIRC 128 is a common threshold from what I remember, in this case.