Drawing a rectangle with dashed lines using Rafael.js

Basic JavaScript error:

{stroke-dasharray:"---"}

Should be:

{"stroke-dasharray":"---"}

Also: "---" isn't a supported value for stroke-dasharray; it should be:

{"stroke-dasharray":"--"}

No "---", possible stroke-dasharray: [“”, “-”, “.”, “-.”, “-..”, “. ”, “- ”, “--”, “- .”, “--.”, “--..”]

One way to color the stroke is to use the HSV or HSL space, then choose the opposite (or nearby) spectrum. Try the answers from: Given an RGB value, how do I create a tint (or shade)?