import 'package:flutter/material.dart';

import '../../../theming/darkAppTheme.dart';

enum CustomTimetableColors {
  orange,
  red,
  green,
  blue
}

class TimetableColors {
  static const CustomTimetableColors defaultColor = CustomTimetableColors.orange;

  static ColorModeDisplay getDisplayOptions(CustomTimetableColors color) {
    switch(color) {
      case CustomTimetableColors.green:
        return ColorModeDisplay(color: Colors.green, displayName: "Grün");

      case CustomTimetableColors.blue:
        return ColorModeDisplay(color: Colors.blue, displayName: "Blau");

      case CustomTimetableColors.orange:
        return ColorModeDisplay(color: Colors.orange.shade800, displayName: "Orange");

      case CustomTimetableColors.red:
        return ColorModeDisplay(color: DarkAppTheme.marianumRed, displayName: "Rot");

    }
  }

  static Color getColorFromString(String color) {
    return getDisplayOptions(CustomTimetableColors.values.firstWhere((element) => element.name == color, orElse: () => TimetableColors.defaultColor)).color;
  }
}

class ColorModeDisplay {
  final Color color;
  final String displayName;

  ColorModeDisplay({required this.color, required this.displayName});
}