@php $themeColorConfig = \App\Models\Configuration::query()->where('label', '=', 'color')->first(); $themeBaseColor = '#' . ltrim(trim((string) ($themeColorConfig->value ?? '#0c447c')), '#'); $r = hexdec(substr($themeBaseColor, 1, 2)); $g = hexdec(substr($themeBaseColor, 3, 2)); $b = hexdec(substr($themeBaseColor, 5, 2)); $darkRatio = 0.25; $darkR = (int) round($r * (1 - $darkRatio)); $darkG = (int) round($g * (1 - $darkRatio)); $darkB = (int) round($b * (1 - $darkRatio)); $lightRatio = 0.35; $lightR = (int) round($r + (255 - $r) * $lightRatio); $lightG = (int) round($g + (255 - $g) * $lightRatio); $lightB = (int) round($b + (255 - $b) * $lightRatio); $softRatio = 0.88; $softR = (int) round($r + (255 - $r) * $softRatio); $softG = (int) round($g + (255 - $g) * $softRatio); $softB = (int) round($b + (255 - $b) * $softRatio); $themeDarkColor = sprintf('#%02X%02X%02X', $darkR, $darkG, $darkB); $themeLightColor = sprintf('#%02X%02X%02X', $lightR, $lightG, $lightB); $themeSoftColor = sprintf('#%02X%02X%02X', $softR, $softG, $softB); @endphp