Read through the code and migration guide but still having trouble supporting the end result here.
Axioms
- the vast majority of production codebases use .withOpacity(x), where x is 0.0–1.0 1
- the internal implementation is now .withOpacity(x) => .withAlpha((255.0*x).round()); 2
- the migration docs say to migrate .withOpacity(x) => .withValues(alpha: x); 3
- .withValues(alpha: x) is more verbose and less obvious than .withOpacity(x) 4
- designers communicate opacity as a percentage from 0%–100% not an integer from 0–255 5
Questions
- why doesn't the internal implementation match the migration docs
- why does withAlpha(x) take an int 0–255 and withValues(alpha: x) take a double 0–1.0
- why does .withOpacity need to be deprecated at all
Recommendations
- unify alpha to a double or an int across all color methods
- undeprecate withOpacity method
- undeprecate opacity getter
Read through the code and migration guide but still having trouble supporting the end result here.
Axioms
Questions
Recommendations