Skip to content

Commit

Permalink
Unlimited Color hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew committed Nov 1, 2023
1 parent fbfcb45 commit 91f22da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/timetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export const createTimetableFromCourses = (data: CourseDefinition[], theme = 'ts
//get the start and end time
const startTime = Math.min(...times);
const endTime = Math.max(...times);
//get the color
const color = timetableColors[theme][data!.indexOf(course)];
//get the color, mod the index by the length of the color array so that it loops
const color = timetableColors[theme][data!.indexOf(course) % timetableColors[theme].length];
//push to scheduleData
newTimetableData.push({
course: course,
Expand Down

0 comments on commit 91f22da

Please sign in to comment.