diff options
| -rw-r--r-- | lib/ruby2d/image.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ruby2d/image.rb b/lib/ruby2d/image.rb index dad263b..0546db5 100644 --- a/lib/ruby2d/image.rb +++ b/lib/ruby2d/image.rb @@ -4,7 +4,7 @@ module Ruby2D class Image attr_accessor :x, :y, :width, :height, :data - attr_reader :path + attr_reader :path, :color def initialize(x, y, path) @@ -14,12 +14,17 @@ module Ruby2D @type_id = 3 @x, @y, @path = x, y, path + @color = Color.new([1, 1, 1, 1]) if Module.const_defined? :DSL Application.add(self) end end + def color=(c) + @color = Color.new(c) + end + def remove if Module.const_defined? :DSL Application.remove(self) |
