I would like to draw a rectangle with a double color border: the border should be a line dashed with two alternating colors (blue and red, for example). Is it possible?
As mentionned in Martin's comment, the trick is to draw the line twice. One of the constraints on paths in Tikz/PGF is that the color is global to the path.
Other than drawing a solid line covered by a dashed line, you may draw two dashed lines, with spaces between the dashes, as given by the following example (you can find more information in the Tikz manual) :
The outcome is
(Following a comment by Caramdir) : The same result can be achieved with a postaction, and the path only has to be specified once :
(Following a request for a rectangle) * I'm not sure this answers the question in the comment *
For a rectangle you would type in the command
This rectangle does not have rounded corners, it is a "normal" rectangle. If ever you do want rounded corners, add
|show 4 more comments|