Module: Fzeet::UIRibbon::Color
- Defined in:
- lib/fzeet/UIRibbon.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bleach(amount) ⇒ Object
- #darken(amount) ⇒ Object
- #lighten(amount) ⇒ Object
- #saturate(amount) ⇒ Object
- #shift(amount) ⇒ Object
Class Method Details
.enhance(hsb, ribbon, method) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fzeet/UIRibbon.rb', line 35 def self.enhance(hsb, ribbon, method) hsb.instance_variable_set(:@ribbon, ribbon) hsb.instance_variable_set(:@method, method) class << hsb attr_reader :ribbon, :method include Color end hsb end |
Instance Method Details
#bleach(amount) ⇒ Object
52 |
# File 'lib/fzeet/UIRibbon.rb', line 52 def bleach(amount) self[1] -= amount; ribbon.send("#{method}=", self); self end |
#darken(amount) ⇒ Object
48 |
# File 'lib/fzeet/UIRibbon.rb', line 48 def darken(amount) self[2] -= amount; ribbon.send("#{method}=", self); self end |
#lighten(amount) ⇒ Object
49 |
# File 'lib/fzeet/UIRibbon.rb', line 49 def lighten(amount) self[2] += amount; ribbon.send("#{method}=", self); self end |
#saturate(amount) ⇒ Object
51 |
# File 'lib/fzeet/UIRibbon.rb', line 51 def saturate(amount) self[1] += amount; ribbon.send("#{method}=", self); self end |
#shift(amount) ⇒ Object
54 |
# File 'lib/fzeet/UIRibbon.rb', line 54 def shift(amount) self[0] += amount; ribbon.send("#{method}=", self); self end |