public Morph ( byte channel, byte index, byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void | ||
channel | byte | Channel (0 - R, 1 - G, 2 - B) |
index | byte | Index of the LED |
r | byte | The red component. |
g | byte | The green component. |
b | byte | The blue component. |
duration | int | How long should the morph last |
steps | int | How many steps for color changes |
return | void |
public void Morph(byte channel, byte index, byte r, byte g, byte b, int duration=1000, int steps=50)
{
if (stopped)
return;
byte cr, cg, cb;
GetColor(index, out cr, out cg, out cb);
for (int i = 1; i <= steps; i++)
{
this.InternalSetColor(channel, index,
(byte)(1.0 * cr + (r - cr) / 1.0 / steps * i),
(byte)(1.0 * cg + (g - cg) / 1.0 / steps * i),
(byte)(1.0 * cb + (b - cb) / 1.0 / steps * i));
if (!WaitThread(duration / steps))
return;
}
}
BlinkStick::Morph ( |
|
BlinkStick::Morph ( byte channel, byte index, |
|
BlinkStick::Morph ( byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void | |
BlinkStick::Morph ( byte channel, byte index, string color, int duration = 1000, int steps = 50 ) : void | |
BlinkStick::Morph ( string color, int duration = 1000, int steps = 50 ) : void |