// Simple dashed pattern on circle with mask
var s = Snap("#svg");
var bigCircle = s.circle(150, 150, 100).attr({
fill: "#bada55",
stroke: "#000",
strokeWidth: 6
});
var p = s.path("M110,95,95,110M115,100,100,115").attr({
fill: "none",
stroke: "#bada55",
strokeWidth: 4
});
var ptrn = p.pattern(100, 100, 10, 10);
bigCircle.attr({
fill: ptrn
});
//Here is our circle from the first Snap-bit.
//Lets create a masking circle
var ring = s.circle(150, 150, 92).attr({
fill: "none",
stroke: "#fff",
strokeWidth: 10
});
//This looks correct, but only because our background is white
s.rect(0, 150, 300, 30).attr({fill: "#85144B"}).insertBefore(bigCircle);
//Uh-oh, lets try to apply this ring as a mask:
bigCircle.attr({
mask: ring
});
//Not exactly what we want. We need to invert the mask