diff options
author | Valerio Virgillito | 2012-06-28 14:08:06 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-28 14:08:06 -0700 |
commit | 3ba9accb8e1887bfd6f1f912b6135073a3d9c70c (patch) | |
tree | 82984e11a4103265674bb27161a3f76023f9caae /js/tools/BrushTool.js | |
parent | 56d6311f398e04eee3883a5c848fec3b2b53c981 (diff) | |
parent | c1a3bfcc53e4526d5bb54687ba18ccaaefa96fc2 (diff) | |
download | ninja-3ba9accb8e1887bfd6f1f912b6135073a3d9c70c.tar.gz |
Merge pull request #349 from joseeight/Color
Color
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r-- | js/tools/BrushTool.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 5d983a93..85a9e963 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -131,14 +131,17 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
131 | //start a new brush stroke | 131 | //start a new brush stroke |
132 | if (this._selectedBrushStroke === null){ | 132 | if (this._selectedBrushStroke === null){ |
133 | this._selectedBrushStroke = new BrushStroke(); | 133 | this._selectedBrushStroke = new BrushStroke(); |
134 | var colorArray=[0,0,0,0]; | 134 | var colorObj; |
135 | var color = this.options.fill.color; | 135 | var fill = this.options.fill; |
136 | if (color){ | 136 | var color = fill.color; |
137 | colorArray = [color.r/255, color.g/255, color.b/255, color.a]; | 137 | if(fill.colorMode === "gradient") { |
138 | colorObj = {gradientMode:fill.color.gradientMode, color:fill.color.stops}; | ||
139 | } else if (color) { | ||
140 | colorObj = [color.r/255, color.g/255, color.b/255, color.a]; | ||
138 | } else { | 141 | } else { |
139 | colorArray = [1,1,1,0]; | 142 | colorObj = [1,1,1,0]; |
140 | } | 143 | } |
141 | this._selectedBrushStroke.setFillColor(colorArray); | 144 | this._selectedBrushStroke.setFillColor(colorObj); |
142 | 145 | ||
143 | //add this point to the brush stroke in case the user does a mouse up before doing a mouse move | 146 | //add this point to the brush stroke in case the user does a mouse up before doing a mouse move |
144 | var currMousePos = hitRec.calculateStageWorldPoint(); | 147 | var currMousePos = hitRec.calculateStageWorldPoint(); |