Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raphael: Set Line Color

I am using the Raphael JS vector library and I cannot get a line (path) that I am drawing to change colors. Hopefully it's just something stupid I did.

var blue_one = paper.path ("M205 205L300 300");
blue_one.attr ("stroke-width", "3");
blue_one.attr ("fill", "#0000FF");

I have also tried fill values of "#00F", "blue", "0000FF", and "00F".

like image 358
Nik Avatar asked Jun 07 '11 13:06

Nik


1 Answers

This is what you want to set.

blue_one.attr ("stroke", "#0000FF");

For a full listing of the properties, see the Specification or the Raphael Documentation

like image 150
Andrew Avatar answered Sep 18 '22 00:09

Andrew