30 lines
551 B
Dart
30 lines
551 B
Dart
import 'dart:ui';
|
|
|
|
enum ThemeCode{
|
|
background_primary,
|
|
background_secondary,
|
|
background_tertiary,
|
|
text_primary,
|
|
text_secondary,
|
|
text_tertiary,
|
|
button_primary,
|
|
button_secondary
|
|
}
|
|
|
|
abstract class ThemePort {
|
|
late Map<ThemeCode, Color> theme;
|
|
late List<List<Color>> cardColors;
|
|
|
|
Color getColorFor(ThemeCode code){
|
|
Color? c = theme[code];
|
|
if (c == null) {
|
|
throw Exception("Theme key not found");
|
|
}
|
|
return c;
|
|
}
|
|
|
|
List<Color> getCardColorFor(int index){
|
|
return cardColors[index % cardColors.length];
|
|
}
|
|
|
|
} |