Skip to content

Commit 57b501b

Browse files
committed
QR code gradient can now be changed
In Advanced Config: 'qr_code_gradient' => [224, 36, 252, 35, 199, 225, 'diagonal'], In RGB
1 parent 3b97251 commit 57b501b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

resources/views/layouts/sidebar.blade.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,16 @@
683683
try {
684684
$redirectURL = url('').'/'.'u/'.Auth::user()->id;
685685
686+
$argValues = config('advanced-config.qr_code_gradient') ?? [0, 0, 0, 0, 0, 0, 'diagonal'];
687+
list($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7) = $argValues;
688+
686689
if (extension_loaded('imagick')) {
687-
$imgSrc = QrCode::format('png')->gradient(224, 36, 252, 35, 199, 225,'diagonal')->eye('circle')->style('round')->size(1000)->generate($redirectURL);
690+
$imgSrc = QrCode::format('png')->gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL);
688691
$imgSrc = base64_encode($imgSrc);
689692
$imgSrc = 'data:image/png;base64,' . $imgSrc;
690693
$imgType = 'png';
691694
} else {
692-
$imgSrc = QrCode::gradient(224, 36, 252, 35, 199, 225,'diagonal')->eye('circle')->style('round')->size(1000)->generate($redirectURL);
695+
$imgSrc = QrCode::gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL);
693696
$imgSrc = base64_encode($imgSrc);
694697
$imgSrc = 'data:image/svg+xml;base64,' . $imgSrc;
695698
$imgType = 'svg';

0 commit comments

Comments
 (0)