@include('open-graphy::partials.font') @include('open-graphy::partials.styles') @include('open-graphy::partials.js') @php function generateIntermediateColors($startColor, $endColor, $steps) { // Remove the '#' from the color codes $startColor = str_replace('#', '', $startColor); $endColor = str_replace('#', '', $endColor); $startRGB = [ hexdec(substr($startColor, 0, 2)), hexdec(substr($startColor, 2, 2)), hexdec(substr($startColor, 4, 2)) ]; $endRGB = [ hexdec(substr($endColor, 0, 2)), hexdec(substr($endColor, 2, 2)), hexdec(substr($endColor, 4, 2)) ]; $stepRGB = [ ($endRGB[0] - $startRGB[0]) / $steps, ($endRGB[1] - $startRGB[1]) / $steps, ($endRGB[2] - $startRGB[2]) / $steps, ]; $intermediateColors = []; for ($i = 0; $i <= $steps; $i++) { $intermediateRGB = [ round($startRGB[0] + $i * $stepRGB[0]), round($startRGB[1] + $i * $stepRGB[1]), round($startRGB[2] + $i * $stepRGB[2]), ]; $intermediateColors[] = sprintf("#%02x%02x%02x", $intermediateRGB[0], $intermediateRGB[1], $intermediateRGB[2]); } return $intermediateColors; } // Usage $startColor = $templateSettings['start_color']; $endColor = $templateSettings['end_color']; $steps = 5; $colors = generateIntermediateColors($startColor, $endColor, $steps); $textColor = $templateSettings['text_color']; $svg = << SVG; @endphp
@php($imageIsSet = isset($image) && !empty($image))
@if (isset($logo)) @endif

{!! $title !!}

@if ($imageIsSet)
Social Graph Image
@endif