brightness function

RGBA brightness (RGBA color, num adj)

Implementation

RGBA brightness(RGBA color, num adj) {
  adj = (adj > 1) ? 1 : adj;
  adj = (adj < -1) ? -1 : adj;
  adj = ~~(255 * adj).round();
  return new RGBA(
      red: clampPixel(color.red + adj),
      green: clampPixel(color.green + adj),
      blue: clampPixel(color.blue + adj),
      alpha: color.alpha);
}