Class: Ruby2D::Color::Set
- Inherits:
-
Object
- Object
- Ruby2D::Color::Set
- Defined in:
- lib/ruby2d/color.rb
Overview
Color::Set represents an array of colors
Instance Method Summary collapse
- #[](i) ⇒ Object
-
#initialize(colors) ⇒ Set
constructor
A new instance of Set.
- #length ⇒ Object
- #opacity ⇒ Object
- #opacity=(opacity) ⇒ Object
Constructor Details
Instance Method Details
#[](i) ⇒ Object
12 13 14 |
# File 'lib/ruby2d/color.rb', line 12 def [](i) @colors[i] end |
#length ⇒ Object
16 17 18 |
# File 'lib/ruby2d/color.rb', line 16 def length @colors.length end |
#opacity ⇒ Object
20 |
# File 'lib/ruby2d/color.rb', line 20 def opacity; @colors[0].opacity end |
#opacity=(opacity) ⇒ Object
22 23 24 25 26 |
# File 'lib/ruby2d/color.rb', line 22 def opacity=(opacity) @colors.each do |color| color.opacity = opacity end end |