-
Notifications
You must be signed in to change notification settings - Fork 6k
soften shadows even more; fix shadow alpha #18029
Conversation
| /// | ||
| /// Flutter shadows look softer than the color specified by the developer. For | ||
| /// example, it is common to get a solid black for a shadow and see a very soft | ||
| /// shadow. This function softens the color by reducing its alpha by a constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a linear reduction the best option? Would it make sense for already softer-alpha shadows to reduce by an even smaller factor than 0.3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to change it if there's a concrete use-case. This seems to work fine for the gallery (at least all the places where I could find shadows).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's chat about a different way to adjust alpha. This seems to fix the immediate issue. We can improve it further in subsequent PRs.
globalAlphato make the shadow transparent rather than usingrgbaonshadowColor, which is not supported as of today.This requires a golden update: flutter/goldens#90
Fixes flutter/flutter#55786
Fixes flutter/gallery#118
Examples:
Slider before:
Slider after:
Appbar before:
Appbar after:
Gallery before:
Gallery after:
Shrine demo before:
Shrine demo after: