m3eOverlayOpacityFor function
Opacity for a gradient state layer from states.
Implementation
double m3eOverlayOpacityFor(Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return 0;
}
if (states.contains(WidgetState.pressed)) {
return M3EStateOpacity.pressed;
}
// Focus chrome is the outset ring (keyboard); no sticky focus fill.
if (states.contains(WidgetState.hovered)) {
return M3EStateOpacity.hover;
}
return 0;
}