Closed NeXTs closed 8 years ago
<Hexagon
style={{
stroke: 'cyan',
fill: 'url(#blueHexagonGradient)'
}}>
<text x="50%" y="70%">Some text!</text>
<defs>
<linearGradient id="blueHexagonGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stopColor="#6465b7"></stop>
<stop offset="100%" stopColor="#473cb2"></stop>
</linearGradient>
</defs>
</Hexagon>
thanks!
Demo updated with example, by the way: http://rexxars.github.io/react-hexagon/
Also, be careful to set unique ids on the gradients :-)
How to apply gradient instead of image?
Let's say I have gradient
I want to use by calling
url(#blueHexagonGradient)