-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.r: solvedIssue is closed as solvedIssue is closed as solvedteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
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
hamza-imran75, luketg8, kkoskenvirta, chotixity, yigtkaya and 379 moreOlegBezr and benthillerkusobumnwabude, albermoon, nank1ro, itsamit108, mcastany and 37 moreyigtkaya, alexmercerind, dipankrr, isaacadariku, mariopepe and 66 morenicks101, mcastany, mrverdant13, TheRogue76, RishiAhuja and 18 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.r: solvedIssue is closed as solvedIssue is closed as solvedteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team