Changing event text colours

Notes on our latest calendar for FileMaker 13,: DayBack
Posts: 2
Joined: Sun Jun 28, 2015 11:30 am
PostPosted: Thu Jul 02, 2015 11:50 am
I see in some of the demo videos that the WebViewer display has some of the events with Black text and some have White text, I assume based on Status.

I can't find any further information about this and would like to do something similar, or at least change all of the text in the event's display black.
SeedCode Staff
SeedCode Staff
Posts: 475
Joined: Wed Jan 02, 2013 11:47 am
PostPosted: Thu Jul 02, 2015 1:01 pm
The text color (black vs white) is based on an evaluation of the selected status color. In general, "lighter" colors will be paired with black text and "darker" colors will be paired with white text. Unfortunately this isn't something you can control manually.
Posts: 21
Joined: Tue Dec 08, 2015 12:38 pm
PostPosted: Tue Jun 07, 2016 1:17 pm
I really like your DayBack Calendar but I am a bit disappointed by the color behaviour used for events. I can understand the idea to let the system use automatically the color background, as you said, based on "lighter" or "darker" color. Unfortunately the algorithm is far from perfect! In the attachment you can see a poor example. Too light text on light background and too dark text on dark background.

If it is too difficult to correct the behaviour, would it be possible to get the control on the color of background AND text?

Thanks!

Denis
Attachments
Capture d’écran 2016-06-07 à 17.06.12.png
Capture d’écran 2016-06-07 à 17.06.12.png (26.6 KiB) Viewed 26598 times
SeedCode Staff
SeedCode Staff
Posts: 190
Joined: Tue Sep 22, 2015 2:27 pm
PostPosted: Wed Jun 08, 2016 7:43 am
Hi Denis,

Thanks so much for reaching out about this. You're right that the algorithm for the text color on events is not terribly complex, however it is consistent. In your RGB values, if both the G and B values (the second and third numbers) are at least 100, then the text will be black. If either of those values if below 100, then the font will be white.

I suspect that minor adjustments in your status colors, according to that font color rule, will let you get the font colors to appear as desired. If that doesn't work for you, you can edit DayBack's CSS theme, forcing all events to have text color of either white or black (or another color). Then, you could choose status colors that work with your fixed text color.

Let me know if that helps, and keep us posted with any other questions on this.

All the best,
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Wed Feb 15, 2017 1:17 pm
Dan, what is the name of the CSS class that would make all text black?
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Wed Feb 15, 2017 1:43 pm
Hi Jim,

Adding the following to your CSS file will set the text color of all events to black:

Code: Select all
.fc-event {
color: rgba(0,0,0,1) !important;
}


You can adjust the "rgb" values to change the color and the "a" value to adjust the transparency of the text.

Hope that helps!

KC
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Wed Feb 15, 2017 2:24 pm
Thanks KC. That worked a treat.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Wed Feb 15, 2017 4:33 pm
That's great to hear, Jim!

Thanks for letting us know.

KC
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Mon Apr 24, 2017 12:14 pm
Just noticed that my changes to my CSS suddenly stopped working. I added the css code to the bottom of the default css file and saved it as a new css file. Some text is black but most of it is white. My client says this just started happening.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon Apr 24, 2017 1:32 pm
Hi Jim,

It sounds like it's possible that some more recent changes to the CSS file may have an unclosed bracket {}, parenthesis (), or semicolon that prevents the attributes below it in the file to not be applied to the calendar.

Is it possible that the CSS file was changed recently? If so, the next step would be to take a look at those changes and verify they're properly formatted or restore from a backup.

Let us know if that helps!

Regards,

KC
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Mon Apr 24, 2017 1:46 pm
Nobody touched the css file but me when I first added the .fc-event class. When I first put it in it was into the default css and since it worked I left it there. Now this week it suddenly doesn't work, and when I looked into the code it's completely missing from the file. So I added into my own named css file just now but it doesn't work even though it's supposedly active. I will look over the css for syntax errors and report back.
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Mon Apr 24, 2017 1:49 pm
I resolved the problem. It looks like there was a missing tag at the end of the last comment "*/". I added this and it works fine. Still not sure why it vanished in the first place. Thanks for you help.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Tue Apr 25, 2017 7:35 am
Hi Jim,

Great to hear you got your CSS back and working.

The default CSS files can be reset to their original state if someone accesses the "WebViewer: Under The Hood" layout and clicks the "Restore Built-In Themes" button.

One idea that may prevent this from happening is to edit the theme and click the "Save As New Theme & Apply" button. This way it can't be overwritten by restoring the default themes.

Hope that helps!

Regards,

KC
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am
PostPosted: Tue Apr 25, 2017 8:49 am
The theme disappeared again this morning but I think I may know why. People were trying to make new FM records when on the calendar and I think this was triggering a script that keeps the number of records at 1. It may have been removing the custom css and reverting back to defaults. I am removing the user's ability to make new FM records when looking at the calendar. Hopefully that was it, otherwise there may be larger issues here.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Tue Apr 25, 2017 9:48 am
Hi Jim,

I'm glad you pointed that out. That is the behavior you will see if a new CalendarInterface record is created. We suggest making a custom menu set with the "Records" menu removed to prevent this from happening.

Here's the section of our troubleshooting docs going over this. Sorry I didn't point this out earlier: https://www.seedcode.com/pmwiki/index.p ... ooting#CSS

Thanks,

KC
Next

Return to DayBack Calendar for FileMaker

Who is online

Users browsing this forum: No registered users and 3 guests

cron
(855) SEEDCODE
[email protected]
Follow us: