danielthor/blink_stick — pull request #10 by bjoska (2014-02-12 21:49:56+00:00)
Title: [Issue #7] Add FadeAction and Pulse

This commit carries with it 2 features:

1. The fade feature.
This can be invoked like so to fade from red to green:
[255, 0, 0] the start color.
[0, 255, 0] the end color.
{ time: 2 } the time it should take the fade to take.

```ruby
bs = BlinkStick.first
bs.fade([255, 0, 0], [0, 255, 0], time: 2)
```
2. The pulse feature
This incorporates fade to do its "magic".
Pulse essentially means that the blinkstick will travel from the
'off' color to the given color and then back to 'off'.
This can be invoked as follows:

2 the number of times to pulse, this can be any number of times.
[20, 70, 128] the color to pulse.

```ruby
bs = BlinkStick.first
bs.pulse(2, [20, 70, 128])
```

2 the number of times to pulse, this can be any number of times.
```ruby
bs.white_pulse(2)
bs.blue_pulse(2)
bs.green_pulse(2)
bs.red_pulse(2)
```

Will pick a random color.
```ruby
bs.random_pulse(2)
```

TODO: Test, there are no tests for this. :(

Big thanks to @danielthor for nudge in a different direction on how to
write this.