0

I was trying to add gradient to the text in my react-native project using react-native-svg

<Svg height="50"
         width="300" >
        <LinearGradient id="Gradient" x1="0" x2="800" y1="0" y2="0">
        <Stop offset="0" stopColor="#C2515D" stopOpacity="0" />
    <Stop offset="1" stopColor="black" stopOpacity="1" />
        </LinearGradient>
      <Text fill="url(#Gradient)"
      x="0"
      y="30"
      fontSize="30"
      textAnchor="start">
          Sign Up
      </Text>
    </Svg>

Here I was getting only (#C2515D) this color, I cant able to get black color, trying from 5 hours. Any suggestions?

1 Answers1

1

It is all because of X2 position, I changed my x2 position to 100 and set the stop color as

     `<Stop  stopColor="#C2515D" offset="0%" />
      <Stop stopColor="black" offset="70%" />

`

Hope this helps someone who got struck with this issue