brighter method
Returns a brighter color using amount
(from 0 to 255) to increase bright.
def
The default color to return if it's not possible to generate a brighter color.
Implementation
HTMLColor? brighter([int? amount, HTMLColor? def]) {
var space = getBrighterSpace();
if (def != null && space <= 2) return def;
amount ??= _colorChangeAmount(space);
var minAmount = Math.min(amount ~/ 2, 10);
if (space < amount) {
if (space < minAmount) return def;
amount = space;
}
return HTMLColor(_clip(red + amount), _clip(green + amount),
_clip(blue + amount), alpha);
}