From cf9b89a5bef9d7855ef91cb84bfa00da5b82b8eb Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Fri, 30 Oct 2026 14:38:10 +0100 Subject: [PATCH] fix(ios): apply box shadow alpha only once CALayer multiplies shadowOpacity with the alpha of shadowColor. The box shadow code set shadowOpacity to color.a / 255 while also passing a CGColor already carrying that alpha, so an alpha color rendered with a^2 (e.g. #00000033 showed as 0.04 instead of 0.2). Keep the alpha in the CGColor and set shadowOpacity to 1, matching Android. Co-Authored-By: Claude Sonnet 5.5 --- packages/core/ui/styling/background.ios.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/ui/styling/background.ios.ts b/packages/core/ui/styling/background.ios.ts index 1e5826ffe3..3c53b7134c 100644 --- a/packages/core/ui/styling/background.ios.ts +++ b/packages/core/ui/styling/background.ios.ts @@ -1137,8 +1137,9 @@ function drawBoxShadow(view: View): void { shadowLayer.allowsEdgeAntialiasing = true; shadowLayer.contentsScale = Screen.mainScreen.scale; - // Shadow opacity is handled on the shadow's color instance - shadowLayer.shadowOpacity = boxShadow.color?.a ? boxShadow.color.a / 255 : 1; + // Shadow alpha is already carried by the CGColor set below, and CALayer multiplies + // shadowOpacity with it, so keep opacity at 1 to apply the alpha only once. + shadowLayer.shadowOpacity = 1; // Use this multiplier to imitate CSS shadow blur shadowLayer.shadowRadius = shadowRadius * 0.5; shadowLayer.shadowColor = boxShadow.color?.ios?.CGColor;