[Android] react-native ART and RadialGradient
See original GitHub issue- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Environment
OS: Windows 10 Node: 8.9.4 Yarn: 1.5.1 npm: 4.6.1 Watchman: Not Found Xcode: N/A Android Studio: Version 3.0.0.0 AI-171.4443003
Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.0 => 0.52.0
Steps to Reproduce
Use react-native ART to draw a shape and fill it with RadialGradient.
import React from "react";
import { View, ART, StyleSheet } from "react-native";
const { Surface, Shape, Group, Path, RadialGradient, LinearGradient } = ART;
const fullRectangle = (width, height) => {
const d = new Path();
d.moveTo(0, 0);
d.lineTo(width, 0);
d.lineTo(width, height);
d.lineTo(0, height);
d.lineTo(0, 0);
return d;
};
export default (props) => (
<Surface style={styles.surface} width={props.width} height={props.height}>
<Group>
<Shape
d={fullRectangle(props.width, props.height)}
fill={
new RadialGradient(
{
".1": "blue", // blue in 1% position
"1": "rgba(255, 255, 255, 0)" // opacity white in 100% position
},
"200",
"200",
"0",
"0",
"0",
"400"
)
}
/>
</Group>
</Surface>
);
Expected Behavior
Shape should be filled with a radial gradient.
Actual Behavior
Shape filled in black. Whatever parameters/colors I use.
note: fill with a solid color or linear gradient is working.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
React Native: Radial Gradient Background
Is there an package, or another way to have a simple, let's say blue to blueish, radial gradient background ...
Read more >Issue in installing react-native-radial gradient in android
I am trying to implement react-native-radial-gradient but it is working in iOS and not implementing in android. the error is.
Read more >react-native-svg - npm
The element is used to define a radial gradient. The element must be nested within a <Defs> tag. The <Defs> tag is short...
Read more >Gradient
react-native -svg. SVG library for react-native. react-componentreact-nativeiosandroidwindowsSVGARTVMLgradient ; expo-linear-gradient. Provides a React component ...
Read more >react-native-art-svg - npm Package Health Analysis
Learn more about react-native-art-svg: package health score, popularity, ... is built to provide a SVG interface to react native on both iOS and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
same with 0.54
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.54?
Thank you for your contributions.