darker method
Returns a darker version of this color by moving closer to black.
amount must be between 0.0 (no change) and 1.0 (full black).
Implementation
Color darker([double amount = .1]) {
assert(amount >= 0.0 && amount <= 1.0);
final r = ((this.r * 255.0).round() - ((this.r * 255.0).round() * amount))
.round()
.clamp(0, 255);
final g = ((this.g * 255.0).round() - ((this.g * 255.0).round() * amount))
.round()
.clamp(0, 255);
final b = ((this.b * 255.0).round() - ((this.b * 255.0).round() * amount))
.round()
.clamp(0, 255);
return Color.fromARGB((a * 255.0).round().clamp(0, 255), r, g, b);
}