function fullcalendar_colors_fullcalendar_palette in FullCalendar 8
Same name and namespace in other branches
- 8.3 fullcalendar_colors/fullcalendar_colors.module \fullcalendar_colors_fullcalendar_palette()
Implements hook_fullcalendar_palette().
File
- fullcalendar_colors/
fullcalendar_colors.module, line 61 - Provide integration with Colors module for FullCalendar.
Code
function fullcalendar_colors_fullcalendar_palette($entity) {
$palette = [];
$palettes = \Drupal::service('module_handler')
->invokeAll('colors_palette', [
$entity,
]);
if (!empty($palettes)) {
$palettes = reset($palettes);
$palette['backgroundColor'] = $palettes['bg'];
$palette['borderColor'] = $palettes['borders'];
$palette['textColor'] = $palettes['text'];
}
return $palette;
}