Skip to content

Instantly share code, notes, and snippets.

@andrewn
Created October 13, 2014 10:28
Show Gist options
  • Save andrewn/76aee727cadcf5a6b485 to your computer and use it in GitHub Desktop.
Save andrewn/76aee727cadcf5a6b485 to your computer and use it in GitHub Desktop.
// Turn LED straight on, no transition
powerLED.change({
colour: [255, 255, 255]
});
rgb.on()
rgb.colour([255, 255, 255])
rgb.off()
// Fade LED on rather than just
// turning straight on
powerLED.change({
colour: [255, 255, 0],
transition: {
easing : 'easeInOut',
duration: 1000
}
});
rgb.off()
.colour([255, 255, 255]) // <- happen instantly
// d3 style
rgb.transition() // <- all state changes after
.duration(1000) // transition() happen over
.easing('easeInOut') // time
.on()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment