Created
May 7, 2021 07:54
-
-
Save senoritadeveloper01/51c225259f673077b57c3b08723cc53f to your computer and use it in GitHub Desktop.
Assign Theme Colors to Calendars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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