y2kEdgeShadowAlpha function

int y2kEdgeShadowAlpha(
  1. int shadow
)

The key shadow's alpha × 255 just outside a key's edge, where its rim and the focus ring are seen: 0.9 of the drop shadow's alpha. The shadow is the face shifted down by the offset and blurred with σ = blur / 2, so directly under the bottom edge it covers Φ(offset / σ) ≤ Φ(3 / 2.5) ≈ 0.885 of its alpha for every style the generator draws (offset 2–3 dp, blur 5–8 dp).

Implementation

int y2kEdgeShadowAlpha(int shadow) {
  final a = (shadow >>> 24) & 0xFF;
  return (a * 9 + 5) ~/ 10;
}