Skip to content

Instantly share code, notes, and snippets.

@senoritadeveloper01
Created May 7, 2021 07:54
Show Gist options
  • Save senoritadeveloper01/51c225259f673077b57c3b08723cc53f to your computer and use it in GitHub Desktop.
Save senoritadeveloper01/51c225259f673077b57c3b08723cc53f to your computer and use it in GitHub Desktop.
Assign Theme Colors to Calendars
export abstract class CalendarConstants {
static readonly CALENDAR_THEME_COLORS: string[] = ['calendar-light-green', 'calendar-green', 'calendar-dark-green', 'calendar-light-blue', 'calendar-blue', 'calendar-dark-blue', 'calendar-light-red', 'calendar-pink', 'calendar-claret-red', 'calendar-orange', 'calendar-dark-yellow', 'calendar-yellow'];
}
...
// assign color index
for (let i = 0; i < this.calendars.length; i++) {
this.calendars[i].color = CalendarConstants.CALENDAR_THEME_COLORS[i % CalendarConstants.CALENDAR_THEME_COLORS.length];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment