Manipulate canvas background color in Raphael by using variable paper
javascript, jquery, raphael
Solution
See the answer below for a better way, but you can make a rectangle that fills the whole canvas area:
var paper = Raphael(200, 350, 320, 200);
var rect = paper.rect(0, 0, 320, 200);
rect.attr("fill", "#f00");
rect.attr("stroke", "#f00");
Problem
I want to set the background color to a specific color. I use the following code: ``` //JavaScript Code var paper = Raphael(200, 350, 320, 200); paper.attr("fill", "#f00"); ``` Somehow, this code doesn't work. Please help, how can I set the background color of paper?