withAlpha method

int withAlpha(
  1. int a
)

Returns a new ARGB integer with the updated alpha value (0-255).

Implementation

int withAlpha(int a) {
  final next = (this & 0x00FFFFFF) | ((a & 0xFF) << 24);
  return next.isAnsiIndexed ? 0 : next;
}