the (newest) FullCalendar docu outlines, that "You can use any of the CSS color formats such #f00, #ff0000, rgb(255,0,0), or red." as event background color (https://fullcalendar.io/docs/eventBackgroundColor).
Now I need to split the colors of the event into e.g. green and red, making green for the first 80% and red for the remaining 20% of the event duration. I found a linear-gradient solution, which works fine thanks to another SO topics and that would be a nice solution.
However while "red" and "green" as single values work fine for the "backgroundColor" attribute, the linear-gradient does not change the event color like in this event below:
{
title: 'Long Event',
start: '2020-09-07',
end: '2020-09-10',
backgroundColor : 'linear-gradient(90deg, pink 80%, cyan 0%)'
}
At https://codepen.io/fendrikat/pen/mdPqjJq you have an example - the second event, "Long event" should be with two colors.
To use a class would not make sense, as the actual percentage and colors will differ for every event (one may be 30% yellow and 70% green, another 20% green and 80% red, another 27% and 73%, ...and so on), so I need to control this in the javascript code.
Anyone any thoughts how the linear-gradient can work for a FullCalendar event in backgroundColor ?
Thanks a lot,
Frank
#f00
,#ff0000
,rgb(255,0,0)
, orred
." There is no mention of gradients. Furthermore, thebackground-color
CSS rule cannot hold a gradient; that is up to thebackground
. A user mentions, in a closed Github ticket, that you could provide your own rendering. – Mr. PolywhirleventRender
solution from arshaw's comment in the Github issue. – Mr. Polywhirl