Color withOpacityX(double opacity) { assert(opacity >= 0.0 && opacity <= 1.0); return this.withAlpha((255.0 * opacity).round()); }