mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user