@php $colors = [ '#f87171', '#fbbf24', '#34d399', '#60a5fa', '#a78bfa', '#f472b6', '#fb923c', '#4ade80' ]; $segments = $summary['segments'] ?? []; $percentages = $summary['percentages'] ?? []; $currentStart = 0; $gradients = []; $i = 0; foreach ($segments as $label => $value) { $color = $colors[$i % count($colors)]; $percent = $percentages[$label] ?? 0; $end = $currentStart + $percent; $gradients[] = "{$color} {$currentStart}% {$end}%"; $currentStart = $end; $i++; } $gradientCss = implode(', ', $gradients); @endphp