summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-02-16 23:58:23 -0500
committerTom Black <[email protected]>2017-02-16 23:58:23 -0500
commita583129cd8aab9ee275bc54254a0bd5fc7fe09a7 (patch)
treebe61a3afeb32480a09599a44ecacb3ecea0e1d84
parent970377ef05302bccab671e0916a30eebd1233f3b (diff)
downloadruby2d-a583129cd8aab9ee275bc54254a0bd5fc7fe09a7.tar.gz
ruby2d-a583129cd8aab9ee275bc54254a0bd5fc7fe09a7.zip
Add color to image class
-rw-r--r--lib/ruby2d/image.rb7
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)