summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/rooms/_walls.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/rooms/_walls.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/_walls.js37
1 files changed, 36 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/engine/rooms/_walls.js b/public/assets/javascripts/rectangles/engine/rooms/_walls.js
index 046961b..f2f395b 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/_walls.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/_walls.js
@@ -86,8 +86,43 @@
var wall = base.lookup[ wall_data.id ]
wall.deserialize( wall_data )
})
+ },
+
+ base.setColor = {
+
+ wall: function(rgb){
+ var rgbaColor = rgba_string(rgb, app.defaults.wallOpacity)
+ Walls.colors.wall = rgb
+ Walls.forEach(function(wall){
+ wall.outline(rgbaColor, null)
+ })
+ },
+
+ outline: function(rgb){
+ var rgbColor = rgb_string(rgb)
+ Walls.colors.outline = rgb
+ Walls.forEach(function(wall){
+ wall.outline(null, rgbColor)
+ })
+ },
+
+ floor: function(rgb){
+ var rgbColor = rgb_string(rgb)
+ Walls.colors.floor = rgb
+ Rooms.forEach(function(room){
+ room.setFloorColor(rgbColor)
+ })
+ },
+
+ ceiling: function(rgb){
+ var rgbColor = rgb_string(rgb)
+ Walls.colors.ceiling = rgb
+ Rooms.forEach(function(room){
+ room.setCeilingColor(rgbColor)
+ })
+ },
+
}
-
}
if ('window' in this) {