brighten method

TinyColor brighten([
  1. int amount = 10
])

Implementation

TinyColor brighten([int amount = 10]) {
  final p = RangeError.checkValueInInterval(amount, 0, 100, 'amount') / 100;
  _color = Color.fromARGB(
    _color.alpha,
    math.max(
      0,
      math.min(
        255,
        _color.red - (255 * -p).round(),
      ),
    ),
    math.max(
      0,
      math.min(
        255,
        _color.green - (255 * -p).round(),
      ),
    ),
    math.max(
      0,
      math.min(
        255,
        _color.blue - (255 * -p).round(),
      ),
    ),
  );
  return this;
}