From a10b81e8ef9d56637cba0b4e9440ad4494a72e77 Mon Sep 17 00:00:00 2001 From: Tsah Kashkash Date: Tue, 24 Dec 2019 16:46:55 +0200 Subject: [PATCH] Updated color_contrast using hexdec deperecated Changed the hexdec to ctype_xdigit due to deprecation and error in status page on php 7.4 --- app/helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers.php b/app/helpers.php index cb9f911b..d1f03254 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -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';