@forelse($available as $c)
@php
// Données API
$hexRaw = $c['hex'] ?? null;
// Normalisation: ajoute # si manquant, uppercase
$hex = $hexRaw ? (str_starts_with($hexRaw, '#') ? $hexRaw : '#'.$hexRaw) : null;
$hexLabel = $hex ? strtoupper($hex) : 'N/A';
$already = $c['already_selected'] ?? false;
$valueDisplay = $c['value_display'] ?? ($c['value'] ?? '');
$idApi = $c['id'] ?? null;
// Style puce
$chipColor = $hex ?? '#ffffff';
$chipBorder = $hex ? '#ccc' : '#888';
@endphp
{{ $valueDisplay }}
{{ $c['type'] ?? '' }} — API #{{ $idApi }}
HEX :
{{ $hexLabel }}
@if($already || !$idApi)
@else
@endif
Aucune couleur trouvée.