Skip to content

Have a new texture instance with a copy() method #16

@riccardoscalco

Description

@riccardoscalco

At the moment a new texture cannot be created from another one.
The following direction has been suggest on issue #7.

var svg = d3.select("#example").append("svg");

var t1 = textures.lines().thicker();
var t2 = t1.copy().fill("red") // This creates a new texture instance

// t1 and t2 would have separate defs in the SVG
svg.call(t1);
svg.call(t2);

svg.append("circle").style("fill", t1.url());
svg.append("circle").style("fill", t2.url());

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions