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

Possible to assign fill to custom paths? #30

Open
ajzeigert opened this issue Aug 3, 2017 · 2 comments
Open

Possible to assign fill to custom paths? #30

ajzeigert opened this issue Aug 3, 2017 · 2 comments
Labels

Comments

@ajzeigert
Copy link

I'm attempting to use the custom path tool to create some shapes that are filled. When I attempt to chain the .fill('#fff') method, I'm getting an error. Is this possible, or am I doing something wrong?

var fill = textures.paths().d(function(s){
// This path is generated by another function that does the sizing
var path = 'M24,3.5999999999999996 L23.1,5.3999999999999995 L23.700000000000003,6.8999999999999995 L25.5,7.5 L27,6.300000000000001 L27,4.199999999999999 z';
return path
})
.size(30)
.strokeWidth(0.5)
.fill('#fff')
.background('#000');
@riccardoscalco
Copy link
Owner

Hi, thanks for reporting the issue.
Actually method fill is not implement for paths, this is not clear in the docs, sorry.
I am going to fix that in the next days.

Looking at your path, it seems too small to be visible.
I created a pen as example: https://codepen.io/riccardoscalco/pen/QMGqpb

As soon as fill method has been implemented I let you know.

@ajzeigert
Copy link
Author

@riccardoscalco Huh, yeah that doesn't look right. I was trying to simplify my example, and I must have mis-copied something.

Here's what I'm really trying to accomplish:

screenshot 2017-08-04 10 38 54

I'm trying to get the shapes filled with white is all. I can do this by just creating a pre-existing pattern def in my SVG, but I was trying to get it to work completely in textures.js and couldn't figure it out. Thanks for the help!

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

No branches or pull requests

2 participants