Class: Kracker::Zooka::Tolerance
- Inherits:
-
Object
- Object
- Kracker::Zooka::Tolerance
- Defined in:
- lib/kracker/zooka/tolerance.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#hue ⇒ Object
Returns the value of attribute hue.
-
#max_brightness ⇒ Object
Returns the value of attribute max_brightness.
-
#min_brightness ⇒ Object
Returns the value of attribute min_brightness.
-
#red ⇒ Object
Returns the value of attribute red.
Instance Method Summary collapse
- #color(c) ⇒ Object
-
#initialize ⇒ Tolerance
constructor
A new instance of Tolerance.
Constructor Details
#initialize ⇒ Tolerance
Returns a new instance of Tolerance.
6 7 8 9 10 11 12 13 14 |
# File 'lib/kracker/zooka/tolerance.rb', line 6 def initialize @red = 16 @green = 16 @blue = 16 @alpha = 16 @min_brightness = 16 @max_brightness = 240 @hue = 0.3 end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def alpha @alpha end |
#blue ⇒ Object
Returns the value of attribute blue.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def green @green end |
#hue ⇒ Object
Returns the value of attribute hue.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def hue @hue end |
#max_brightness ⇒ Object
Returns the value of attribute max_brightness.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def max_brightness @max_brightness end |
#min_brightness ⇒ Object
Returns the value of attribute min_brightness.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def min_brightness @min_brightness end |
#red ⇒ Object
Returns the value of attribute red.
4 5 6 |
# File 'lib/kracker/zooka/tolerance.rb', line 4 def red @red end |
Instance Method Details
#color(c) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/kracker/zooka/tolerance.rb', line 16 def color(c) case c.downcase.to_sym when :alpha @alpha when :red @red when :blue @blue when :green @green when :min_brightness @min_brightness when :hue @hue else 0 end end |