Skip to content

Instantly share code, notes, and snippets.

@nidheeshdas
Created July 21, 2014 10:36
Show Gist options
  • Save nidheeshdas/48ba1fc5774ff4280838 to your computer and use it in GitHub Desktop.
Save nidheeshdas/48ba1fc5774ff4280838 to your computer and use it in GitHub Desktop.
change color of imported svg in fabric js
if (shape.isSameColor && shape.isSameColor() || !shape.paths) {
shape.setFill(colorSet);
} else if (shape.paths) {
for (var i = 0; i < shape.paths.length; i++) {
shape.paths[i].setFill(colorSet);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment