function updateLogoColor() {
let container = document.querySelector(".glassy-container");
let logo = document.querySelector(".logo");
// Get the background color of the element *behind* the glassy container
let bgElement = container.parentElement; // Adjust if needed
let bgColor = window.getComputedStyle(bgElement).backgroundColor; // Convert RGB to brightness level
function getBrightness(color) {
let rgb = color.match(/\d+/g);
return (parseInt(rgb[0]) * 0.299 + parseInt(rgb[1]) * 0.587 + parseInt(rgb[2]) * 0.114);
} let brightness = getBrightness(bgColor);
// If brightness is below 128 (dark), switch logo to white
logo.style.color = brightness < 128 ? "white" : "black";
} // Run on page load and window resize
window.addEventListener("load", updateLogoColor);
window.addEventListener("resize", updateLogoColor);