diff --git a/inc/inc.ClassViewCommon.php b/inc/inc.ClassViewCommon.php index 04e31cd10..63d9f276d 100644 --- a/inc/inc.ClassViewCommon.php +++ b/inc/inc.ClassViewCommon.php @@ -360,7 +360,12 @@ class SeedDMS_View_Common { $r = hexdec(substr($hexcolor, 1, 2)); $g = hexdec(substr($hexcolor, 3, 2)); $b = hexdec(substr($hexcolor, 5, 2)); - $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; - return ($yiq >= 148) ? '000000' : 'ffffff'; + if(0) { + $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; + return ($yiq >= 148) ? '000000' : 'ffffff'; + } else { + $l = (max($r, max($g, $b)) + min($r, min($g, $b)))/2; + return ($l > 128) ? '000000' : 'ffffff'; + } } /* }}} */ }