Estoy trabajando en un componente Svg donde estoy usando LinearGradient de react-native-svg . Quiero usar colores fijos en los puntos de parada. Pero usando LinearGradient , no es posible hacer eso. ¿Cómo puedo agregar un color fijo y lograr algo como esto?
Aquí está mi código actual para este Svg:
<Svg width={svgSize} height={svgSize}> <LinearGradient id="gradient" start={{x: 0.0, y: 0.0}} end={{x: 1.0, y: 1.0}} > <Stop offset="0%" stopColor= 'green' stopOpacity= {1}/> <Stop offset="50%" stopColor= 'red' /> <Stop offset="100%" stopColor= 'blue' /> </LinearGradient> <Path strokeWidth={strokeWidth} stroke="url(#gradient)" d={`M${startPoint.x},${startPoint.y} A ${radius},${radius},0,${startRadian - openingRadian >= Math.PI ? '1' : '0'},1,${endPoint.x},${endPoint.y}`} /> <Path strokeWidth={strokeWidth} stroke="url(#gradient)" fill="none" d={`M${startPoint.x},${startPoint.y} A ${radius},${radius},0,${startRadian - currentRadian >= Math.PI ? '1' : '0'},1,${curPoint.x},${curPoint.y}`} /> <Circle cx={curPoint.x} cy={curPoint.y} r={buttonRadius} fill={buttonFillColor || buttonBorderColor} stroke={buttonBorderColor} strokeWidth={buttonStrokeWidth} {...this._panResponder.panHandlers} /> </Svg> Solo necesito ayuda con la parte del conjunto de colores fijos LinearGradient . ¿Cómo puedo lograr eso?