MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. mwm341
    3. Topics
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 16
    • Groups 0

    Topics

    • M

      Worry about Ubuntu Frame, maybe

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      1
      0 Votes
      1 Posts
      229 Views
      M
      Has anyone else seen this: https://www.zdnet.com/article/say-hello-to-ubuntu-frame/ I’m wondering if it might apply to MagicMirror, and if so, how?
    • M

      Contrasting text on a changing background, again

      Watching Ignoring Scheduled Pinned Locked Moved Custom CSS
      6
      0 Votes
      6 Posts
      1k Views
      S
      @mmrize use translator he wants to know if there are instructions (how to do, how2) for using this idea w mm.
    • M

      Problem with MMM-email

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      12
      0 Votes
      12 Posts
      3k Views
      M
      @mumblebaj said in Problem with MMM-email: @mwm341 I get the following error when I run with the same config as you: [image: 1629471951483-e599e95e-3f0e-476f-b811-dea204f78ce4-image.png] I had to rename the folder but I am getting some other weird errors. I am not too sure if this module still works. Seems like the developer last looked at it 5 years ago. I was wondering about that
    • M

      Contrasting text on changing background

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      4
      0 Votes
      4 Posts
      918 Views
      B
      @sdetweil said in Contrasting text on changing background: @mwm341 I want that too. text over photos. haven’t figured out a way yet. I kludged something together today with the MMM-Wallpaper module. It’s not elegant, but it’s been working for me so far. What I’m doing is having the module draw the image onto an off-screen canvas and compute its average brightness using the luminance formula. Based on whether this brightness exceeds a defined threshold (115 has been working for me), the module then updates a global CSS variable with either a light or dark text color. I’m using color: var(--dynamic-text-color); as the variable. Since it’s determining global brightness, it can still “miss” picking a good color for each module. Depending on compute load, I’m thinking an update would be to determine that brightness value for each quadrant of an image then creating a variable for each quadrant and setting the text style in those areas to that color. A downside to this approach is that it won’t work perfectly with different display aspect ratios, but if you’re only ever using a 16:9 display that would be mitigated. Brightness function: // Helper function to compute average brightness of an image. getAverageBrightness: function(image, callback) { var canvas = document.createElement("canvas"); var width = image.naturalWidth; var height = image.naturalHeight; canvas.width = width; canvas.height = height; var context = canvas.getContext("2d"); context.drawImage(image, 0, 0, width, height); try { var imageData = context.getImageData(0, 0, width, height); } catch (error) { console.error("Error accessing image data:", error); callback(255); // Assume bright background if error. return; } var data = imageData.data; var colorSum = 0; var pixels = data.length / 4; for (var i = 0; i < data.length; i += 4) { var r = data[i]; var g = data[i + 1]; var b = data[i + 2]; // Calculate brightness using the luminance formula. var brightness = 0.299 * r + 0.587 * g + 0.114 * b; colorSum += brightness; } var averageBrightness = colorSum / pixels; callback(averageBrightness); }, Updated onImageLoaded function: onImageLoaded: function(imageData, element) { var self = this; return () => { self.resetLoadImageTimer(); element.className = `wallpaper ${self.config.crossfade ? "crossfade-image" : ""}`; element.style.opacity = 1; // Analyze the image brightness and adjust text color accordingly. // This will update both the module's caption and a global CSS variable. self.getAverageBrightness(element, function(brightness) { var threshold = 128; // Adjust this threshold as needed. var textColor = brightness > threshold ? "black" : "white"; self.title.style.color = textColor; // Set a global CSS variable for dynamic text color. document.documentElement.style.setProperty('--dynamic-text-color', textColor); }); self.title.style.display = "none"; setTimeout(() => { var caption = imageData.caption; if (self.config.caption && caption) { self.title.innerHTML = caption; self.title.style.display = "initial"; } if (self.imageElement !== null) { self.content.removeChild(self.imageElement); } self.imageElement = self.nextImageElement; self.nextImageElement = null; }, self.config.crossfade ? 1000 : 0); }; },
    • M

      Barbershop MMMirror

      Watching Ignoring Scheduled Pinned Locked Moved Requests
      1
      -2 Votes
      1 Posts
      345 Views
      M
      For those who are locked down and need a haircut badly enough to do it themselves. It’s hard to properly cut hair on the side and back of my head when I can’t see it – so I’d love to be able to have a mirror that on command will (wait long enough for me to turn around and) take a photo, and display it long enough for me to evaluate what I’ve done. I’m aware that it might take a bit more hardware and some coding, but need ideas as to how to proceed.
    • M

      I'm looking for an MM module that will play .flac files.

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Forum
      1
      0 Votes
      1 Posts
      201 Views
      M
      I’ve examined some player modules, but am rapidly coming to the conclusion that it might be easiest to convert my 7000+ music files into mp3s. Does anyone have a better idea?
    • 1 / 1