colorClose function
Whether every channel of actual is within tolerance of expected.
Implementation
bool colorClose(List<int> actual, List<int> expected, {int tolerance = 2}) {
if (actual.length != expected.length) return false;
for (var i = 0; i < actual.length; i++) {
if ((actual[i] - expected[i]).abs() > tolerance) return false;
}
return true;
}