diff options
author | Nivesh Rajbhandari | 2012-03-30 13:53:47 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-30 13:53:47 -0700 |
commit | eae317815e15a7ffc2dd1bd1e39b208eaa02fd2b (patch) | |
tree | cae3e2d74529061a04b817ae216c2dbecbb5c5bb /js/tools/ShapeTool.js | |
parent | 80782d5d0721463f716f0a7241afd09a38543199 (diff) | |
download | ninja-eae317815e15a7ffc2dd1bd1e39b208eaa02fd2b.tar.gz |
Update PI and Color Panel to reflect default LinearGradient and RadialGradient materials' colors.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools/ShapeTool.js')
-rwxr-xr-x | js/tools/ShapeTool.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index d3a36163..1a12401f 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -206,7 +206,32 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
206 | } | 206 | } |
207 | }, | 207 | }, |
208 | 208 | ||
209 | _getMaterialColor: { | ||
210 | value: function(m) | ||
211 | { | ||
212 | var css, | ||
213 | colorObj; | ||
214 | if(m === "LinearGradientMaterial") | ||
215 | { | ||
216 | css = "-webkit-gradient(linear, left top, right top, from(rgb(255, 0, 0)), color-stop(0.3, rgb(0, 255, 0)), color-stop(0.6, rgb(0, 0, 255)), to(rgb(0, 255, 255)))"; | ||
217 | } | ||
218 | else if(m === "RadialGradientMaterial") | ||
219 | { | ||
220 | css = "-webkit-radial-gradient(50% 50%, ellipse cover, rgb(255, 0, 0) 0%, rgb(0, 255, 0) 30%, rgb(0, 0, 255) 60%, rgb(0, 255, 255) 100%)"; | ||
221 | } | ||
222 | |||
223 | if(css) | ||
224 | { | ||
225 | colorObj = this.application.ninja.colorController.getColorObjFromCss(css); | ||
226 | if(colorObj) | ||
227 | { | ||
228 | return {gradientMode:colorObj.color.gradientMode, color:colorObj.color.stops}; | ||
229 | } | ||
230 | } | ||
209 | 231 | ||
232 | return null; | ||
233 | } | ||
234 | }, | ||
210 | 235 | ||
211 | // We can draw on an existing canvas unless it has only a single shape object | 236 | // We can draw on an existing canvas unless it has only a single shape object |
212 | _useExistingCanvas: { | 237 | _useExistingCanvas: { |