I pass the resource color to the fullcalendar. According to the documentation if I render a event it should be displayed with the color that I passed to the resource earlier. Strangly this is not the case for me.
This is what I pass to the fullcalendar as a resource
"id" => "erna46"
"title" => "erna46"
"eventColor" => "rgb(45,0,255)"
"eventTextColor" => "rgb(255,255,255)"
Now in my fullcalendar the event is rendered with the color rgb(98,64,255)
I am not sure if this is normal or not and if so is there a way to turn color change off?
Update:
Here is a JSFidle to show the problem:
http://jsbin.com/pofemef/edit?js,output
As you can see i set the color eg rgb(255,147,0) but in the calendar it is displayed as rgb(255,174,64).
After some work i figured it out. By default the appointment will add a background above the appointment with background: #fff and opacity: .25 . This will change the color off the appointment so it appears lighter than the set appointment color.
According to the documentation , eventColor property sets the background and border colors for all events on the calendar, not each event separately. So if you declare an event like this:
events: [{
title: 'event',
start: '2017-01-05 11:00',
end: '2017-01-06 13:00',
eventColor: 'rgb(45,0,255)'
}]
It's not gonna work. You can use eventColor for every event:
events: [{
title: 'event',
start: '2017-01-05 11:00',
end: '2017-01-06 13:00'
}],
eventColor: '#378006'
If you want to change the color for individual events, please look at the Event Object color options
events: [{
title: 'event',
start: '2017-01-05 11:00',
end: '2017-01-06 13:00',
backgroundColor: 'rgb(255,87,90)'
}]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.