MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED MMM-MonthlyCalendar(kolbyjack) event styling problem

    Troubleshooting
    1
    1
    116
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jjjjj last edited by jjjjj

      NVM i got it working by removing everything under the var line
      Im having trouble editing the css of the events here(white boxes), i was able to add borders on them but cant edit the background and text color as i would like to.
      alt text

      I think the problem is because of this in the code but I’m not sure how to change it.
      I would like the background to be transparent and text color white(always)

                var div = el("div", { "className": "event", "innerText": text });
                if (e.color) {
                  var c = e.color;
      
                  if (e.fullDayEvent) {
                    div.style.backgroundColor = c;
                    if (c[0] === "#") {
                      var r, g, b, l;
      
                      if (c.length < 7) {
                        r = parseInt(c[1], 16) * 16 + parseInt(c[1], 16);
                        g = parseInt(c[2], 16) * 16 + parseInt(c[2], 16);
                        b = parseInt(c[3], 16) * 16 + parseInt(c[3], 16);
                      } else {
                        r = parseInt(c.substr(1, 2), 16);
                        g = parseInt(c.substr(3, 2), 16);
                        b = parseInt(c.substr(5, 2), 16);
                      }
      
                      l = 0.299 * r + 0.587 * g + 0.114 * b;
                      if (l >= 128) {
                        div.style.color = "black";
                      }
                    }
                  } else {
                    div.style.color = c;
                  }
                }
      
      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy