courseTableCellPalette function

CourseTableCellPalette courseTableCellPalette(
  1. Color baseColor,
  2. Brightness brightness
)

Derives the timetable-cell palette from its stable base color.

Implementation

CourseTableCellPalette courseTableCellPalette(
  Color baseColor,
  Brightness brightness,
) {
  final isDark = brightness == .dark;
  return (
    container: HSLColor.fromColor(baseColor)
        .withLightness(isDark ? 0.7 : 0.9)
        .withSaturation(isDark ? 0.2 : 0.4)
        .toColor(),
    border: HSLColor.fromColor(baseColor)
        .withLightness(0.3)
        .withSaturation(isDark ? 0.5 : 0.6)
        .toColor(),
    foreground: Colors.grey[900]!,
  );
}