(elevation: number | Animated.Value = 0)
| 71 | } |
| 72 | |
| 73 | function v3Shadow(elevation: number | Animated.Value = 0) { |
| 74 | const inputRange = [0, 1, 2, 3, 4, 5]; |
| 75 | const shadowHeight = [0, 1, 2, 4, 6, 8]; |
| 76 | const shadowRadius = [0, 3, 6, 8, 10, 12]; |
| 77 | |
| 78 | if (elevation instanceof Animated.Value) { |
| 79 | return { |
| 80 | shadowColor: MD3_SHADOW_COLOR, |
| 81 | shadowOffset: { |
| 82 | width: new Animated.Value(0), |
| 83 | height: elevation.interpolate({ |
| 84 | inputRange, |
| 85 | outputRange: shadowHeight, |
| 86 | }), |
| 87 | }, |
| 88 | shadowOpacity: elevation.interpolate({ |
| 89 | inputRange: [0, 1], |
| 90 | outputRange: [0, MD3_SHADOW_OPACITY], |
| 91 | extrapolate: 'clamp', |
| 92 | }), |
| 93 | shadowRadius: elevation.interpolate({ |
| 94 | inputRange, |
| 95 | outputRange: shadowRadius, |
| 96 | }), |
| 97 | }; |
| 98 | } else { |
| 99 | return { |
| 100 | shadowColor: MD3_SHADOW_COLOR, |
| 101 | shadowOpacity: elevation ? MD3_SHADOW_OPACITY : 0, |
| 102 | shadowOffset: { |
| 103 | width: 0, |
| 104 | height: shadowHeight[elevation], |
| 105 | }, |
| 106 | shadowRadius: shadowRadius[elevation], |
| 107 | }; |
| 108 | } |
| 109 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…