Class: CheekyDreams::Effects::FadeTo

Inherits:
Effect
  • Object
show all
Defined in:
lib/cheeky-dreams.rb

Constant Summary

Constants included from CheekyDreams

COLOURS

Instance Method Summary collapse

Methods included from CheekyDreams

#ansi_driver, #audit_to, #crazy, #cycle, #dev_null, #fade, #fade_to, #find_dream_cheeky_usb_device, #forward, #func, #light_show, #max, #off, #position_between, #rgb, #rgb_between, #sleep_until, #solid, #stdio_audit, #stdout_driver, #suppress_duplicates, #throb, #throbbing

Constructor Details

#initialize(to, steps, freq) ⇒ FadeTo

Returns a new instance of FadeTo.



362
363
364
365
# File 'lib/cheeky-dreams.rb', line 362

def initialize to, steps, freq
  @freq, @to, @steps = freq, to, steps
  @fade = nil
end

Instance Method Details

#next(current_colour) ⇒ Object



367
368
369
370
# File 'lib/cheeky-dreams.rb', line 367

def next current_colour
  @fade = Fade.new(current_colour, @to, @steps, @freq) unless @fade        
  @fade.next(current_colour)
end