summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-04-26 16:28:26 -0400
committerTom Black <[email protected]>2017-04-28 18:24:13 -0400
commit7bf37309d9c948df6947caa7d2b56d448a48e7cb (patch)
treea22357ab3b78fca7e6104640623dc6236ea2365f /test
parent8d39db97fd82e99015d31fa38436fea6c1530a87 (diff)
downloadruby2d-7bf37309d9c948df6947caa7d2b56d448a48e7cb.tar.gz
ruby2d-7bf37309d9c948df6947caa7d2b56d448a48e7cb.zip
Opacity improvements
Adds opacity attribute reader for `Ruby2D::Color` and `Ruby2D::Color::Set`. Adds `opacity/=` method to renderable objects, a shortcut for `obj.color.opacity/=`.
Diffstat (limited to 'test')
-rw-r--r--test/color_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/color_spec.rb b/test/color_spec.rb
index 95033a9..0fb65c8 100644
--- a/test/color_spec.rb
+++ b/test/color_spec.rb
@@ -32,4 +32,15 @@ RSpec.describe Ruby2D::Color do
end
end
+ describe '#opacity' do
+ it 'sets and returns the opacity' do
+ s1 = Square.new
+ s1.opacity = 0.5
+ s2 = Square.new(0, 0, 0, ['red', 'green', 'blue', 'yellow'])
+ s2.opacity = 0.7
+ expect(s1.opacity).to eq 0.5
+ expect(s2.opacity).to eq 0.7
+ end
+ end
+
end