getRegionAverage static method
Implementation
static Color getRegionAverage(Uint8List bytes, {String region = 'center', int step = 10}) {
final image = img.decodeImage(bytes);
if (image == null) {
return Colors.white;
}
int startY;
int endY;
if (region == 'top') {
startY = 0;
endY = image.height ~/ 3;
} else if (region == 'bottom') {
startY = image.height * 2 ~/ 3;
endY = image.height;
} else {
startY = image.height ~/ 3;
endY = image.height * 2 ~/ 3;
}
return regionAverage(image, startY, endY, step: step);
}