Skip to content

Commit 2152245

Browse files
authored
Update NativeSvg fore back/foregroundOpacity Svg.tsx
Added `backgroundOpacity` and `foregroundOpacity` freature for Native.
1 parent d6dc935 commit 2152245

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/native/Svg.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class NativeSvg extends Component<IContentLoaderProps> {
1717
static defaultProps = {
1818
animate: true,
1919
backgroundColor: '#f5f6f7',
20+
backgroundOpacity: 1,
2021
foregroundColor: '#eee',
22+
foregroundOpacity: 1,
2123
rtl: false,
2224
speed: 1.2,
2325
interval: 0.25,
@@ -74,7 +76,9 @@ class NativeSvg extends Component<IContentLoaderProps> {
7476
const {
7577
children,
7678
backgroundColor,
79+
backgroundOpacity,
7780
foregroundColor,
81+
foregroundOpacity,
7882
rtl,
7983
style,
8084
beforeMask,
@@ -124,9 +128,9 @@ class NativeSvg extends Component<IContentLoaderProps> {
124128
y1={0}
125129
y2={0}
126130
>
127-
<Stop offset={0} stopColor={backgroundColor} />
128-
<Stop offset={0.5} stopColor={foregroundColor} />
129-
<Stop offset={1} stopColor={backgroundColor} />
131+
<Stop offset={0} stopColor={backgroundColor} stopOpacity={backgroundOpacity} />
132+
<Stop offset={0.5} stopColor={foregroundColor} stopOpacity={foregroundOpacity} />
133+
<Stop offset={1} stopColor={backgroundColor} stopOpacity={backgroundOpacity} />
130134
</AnimatedLinearGradient>
131135
</Defs>
132136
</Svg>

0 commit comments

Comments
 (0)