From 57b501b629fe736efbeb892f633b3d3c6c001da0 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:37:46 +0100 Subject: [PATCH] QR code gradient can now be changed In Advanced Config: 'qr_code_gradient' => [224, 36, 252, 35, 199, 225, 'diagonal'], In RGB --- resources/views/layouts/sidebar.blade.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index ac224953..8e186e4e 100755 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -683,13 +683,16 @@ try { $redirectURL = url('').'/'.'u/'.Auth::user()->id; + $argValues = config('advanced-config.qr_code_gradient') ?? [0, 0, 0, 0, 0, 0, 'diagonal']; + list($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7) = $argValues; + if (extension_loaded('imagick')) { - $imgSrc = QrCode::format('png')->gradient(224, 36, 252, 35, 199, 225,'diagonal')->eye('circle')->style('round')->size(1000)->generate($redirectURL); + $imgSrc = QrCode::format('png')->gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL); $imgSrc = base64_encode($imgSrc); $imgSrc = 'data:image/png;base64,' . $imgSrc; $imgType = 'png'; } else { - $imgSrc = QrCode::gradient(224, 36, 252, 35, 199, 225,'diagonal')->eye('circle')->style('round')->size(1000)->generate($redirectURL); + $imgSrc = QrCode::gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL); $imgSrc = base64_encode($imgSrc); $imgSrc = 'data:image/svg+xml;base64,' . $imgSrc; $imgType = 'svg';