getColor method
- AutonomyCell cell,
- AutonomyModel model
Gets the color for a given AutonomyCell.
Implementation
Color? getColor(AutonomyCell cell, AutonomyModel model) {
if (!model.snapToGrid) {
return null;
}
return switch (cell) {
AutonomyCell.destination => Colors.green,
AutonomyCell.obstacle => Colors.black,
AutonomyCell.path => Colors.blueGrey,
AutonomyCell.empty => null,
AutonomyCell.marker => Colors.red,
AutonomyCell.rover => getColor(model.roverCellType, model),
};
}