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
11 12 13 |
# File 'lib/ruby2d/color.rb', line 11 def [](i) @colors[i] end |
#length ⇒ Object
15 16 17 |
# File 'lib/ruby2d/color.rb', line 15 def length @colors.length end |
#opacity ⇒ Object
19 |
# File 'lib/ruby2d/color.rb', line 19 def opacity; @colors[0].opacity end |
#opacity=(opacity) ⇒ Object
21 22 23 24 25 |
# File 'lib/ruby2d/color.rb', line 21 def opacity=(opacity) @colors.each do |color| color.opacity = opacity end end |