nusmods
nusmods copied to clipboard
feat: Enable flexible number of colors for themes
- instead of fixing the number of colors for a theme to 8 colors, now we are able to support a variable number of colors
- add a new theme, 'Tequila' with 10 colors as Proof of Concept
Context
#3443
Implementation
One issue I was facing was that when shifting from themes with higher number of colors to themes with lower number of colors, some courses would get rendered as white color as their colorIndex exceeds the numOfColors of the current theme. One way to solve this would be to dispatch a new action to set the colorIndex of all courses to colorIndex % numOfColors.