Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinearGradient fill on Polygons #54

Closed
mrozbarry opened this issue Jun 6, 2016 · 2 comments
Closed

LinearGradient fill on Polygons #54

mrozbarry opened this issue Jun 6, 2016 · 2 comments

Comments

@mrozbarry
Copy link

When I attempt to fill a polygon with a linear gradient, I just get the following error:

screen shot 2016-06-06 at 5 40 17 pm

The examples only use Ellipse, so I don't know if this is only supported on non-polygon elements, or if this is a bug.

My code is as follows:

import React, { View } from 'react-native'
import { Svg, Defs, LinearGradient, Stop, G, Polygon } from 'react-native-svg'

export function BlueShard (props) {
  return (
    <View style={props.style}>
      <Svg width="15" height="71">
        <Defs>
          <LinearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="blue-gradient">
            <Stop stopColor="#6ABAD5" stopOpacity="1" offset="0%" />
            <Stop stopColor="#1E9FD6" stopOpacity="1" offset="100%" />
          </LinearGradient>
        </Defs>
        <Polygon fill="url(#blue-gradient)" points='0,0 15,0 0,71' />
      </Svg>
    </View>
  )
}
@magicismight
Copy link
Collaborator

Use id="blueGradient" you should use camel case in React.
It's a bug when parsing full or stroke like url(#xxx-xxx)
I'll fix this later.

@mrozbarry
Copy link
Author

That worked, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants