feat: course color generation (#179)
* feat: course color generation * feat: add proper TS for hex colors * refactor: fix oklab and improve contrast ratios * fix: update HexColor type * refactor: update color switch point * refactor: color-related functions and types * fix: imports and TS issues * fix: imports and TS issues * chore: add no-restricted-syntax ForInStatement * chore(docs): add jsdoc --------- Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
@@ -70,10 +70,19 @@ export default function useSchedules(): [active: UserSchedule, schedules: UserSc
|
||||
return [activeSchedule, schedules];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the active schedule.
|
||||
* @returns The active schedule.
|
||||
*/
|
||||
export function getActiveSchedule(): UserSchedule {
|
||||
return schedulesCache[activeIndexCache] ?? errorSchedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the old schedule with the new schedule.
|
||||
* @param oldSchedule - The old schedule to be replaced.
|
||||
* @param newSchedule - The new schedule to replace the old schedule.
|
||||
*/
|
||||
export async function replaceSchedule(oldSchedule: UserSchedule, newSchedule: UserSchedule) {
|
||||
const schedules = await UserScheduleStore.get('schedules');
|
||||
let oldIndex = schedules.findIndex(s => s.id === oldSchedule.id);
|
||||
|
||||
Reference in New Issue
Block a user