QR code gradient can now be changed

In Advanced Config:

'qr_code_gradient' => [224, 36, 252, 35, 199, 225, 'diagonal'],

In RGB
This commit is contained in:
Julian Prieber 2023-12-06 14:37:46 +01:00
parent 3b9725147b
commit 57b501b629
1 changed files with 5 additions and 2 deletions

View File

@ -683,13 +683,16 @@ $usrhandl = Auth::user()->littlelink_name;
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';