fix: dim accent color for background blobs

CSS wave-blobs now use accent-800 instead of accent-500 for a subdued
background glow. Aurora WebGL shader receives a darkened accent (45%
brightness) so bright accent colors like #e85002 no longer produce
overly intense background blobs while button colors stay unchanged.
This commit is contained in:
c0mrade
2026-02-04 14:51:12 +03:00
parent 576893f5c6
commit bb32cd8757
2 changed files with 19 additions and 4 deletions

View File

@@ -107,8 +107,23 @@ function hexToRgb(hex: string): [number, number, number] {
return [r, g, b];
}
// Reduce lightness of a hex color for subdued background blobs
function dimAccent(hex: string, factor = 0.45): string {
hex = hex.replace('#', '');
if (hex.length === 3) {
hex = hex
.split('')
.map((c) => c + c)
.join('');
}
const r = Math.round(parseInt(hex.substring(0, 2), 16) * factor);
const g = Math.round(parseInt(hex.substring(2, 4), 16) * factor);
const b = Math.round(parseInt(hex.substring(4, 6), 16) * factor);
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
}
function generateColorStops(background: string, surface: string, accent: string): string[] {
return [background, surface, accent];
return [background, surface, dimAccent(accent)];
}
export function Aurora() {