mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-16 13:09:06 +01:00
Updated color_contrast using hexdec deperecated
Changed the hexdec to ctype_xdigit due to deprecation and error in status page on php 7.4
This commit is contained in:
parent
83f7aa9b4c
commit
a10b81e8ef
@ -114,9 +114,9 @@ if (!function_exists('color_contrast')) {
|
||||
*/
|
||||
function color_contrast($hexcolor)
|
||||
{
|
||||
$r = hexdec(substr($hexcolor, 0, 2));
|
||||
$g = hexdec(substr($hexcolor, 2, 2));
|
||||
$b = hexdec(substr($hexcolor, 4, 2));
|
||||
$r = ctype_xdigit(substr($hexcolor, 0, 2));
|
||||
$g = ctype_xdigit(substr($hexcolor, 2, 2));
|
||||
$b = ctype_xdigit(substr($hexcolor, 4, 2));
|
||||
$yiq = (($r * 100) + ($g * 400) + ($b * 114)) / 1000;
|
||||
|
||||
return ($yiq >= 128) ? 'black' : 'white';
|
||||
|
Loading…
x
Reference in New Issue
Block a user