(color, opac, type)
| 117 | } |
| 118 | |
| 119 | var getPaint = function(color, opac, type) { |
| 120 | // update the editor's fill paint |
| 121 | var opts = null; |
| 122 | if (color.indexOf("url(#") === 0) { |
| 123 | var refElem = svgCanvas.getRefElem(color); |
| 124 | if(refElem) { |
| 125 | refElem = refElem.cloneNode(true); |
| 126 | } else { |
| 127 | refElem = $("#" + type + "_color defs *")[0]; |
| 128 | } |
| 129 | |
| 130 | opts = { alpha: opac }; |
| 131 | opts[refElem.tagName] = refElem; |
| 132 | } |
| 133 | else if (color.indexOf("#") === 0) { |
| 134 | opts = { |
| 135 | alpha: opac, |
| 136 | solidColor: color.substr(1) |
| 137 | }; |
| 138 | } |
| 139 | else { |
| 140 | opts = { |
| 141 | alpha: opac, |
| 142 | solidColor: 'none' |
| 143 | }; |
| 144 | } |
| 145 | return new $.jGraduate.Paint(opts); |
| 146 | }; |
| 147 | |
| 148 | // set the canvas properties at init |
| 149 | var res = svgCanvas.getResolution(); |
no test coverage detected