Skip to content

Instantly share code, notes, and snippets.

@jacobp100
Created January 16, 2018 20:20
Show Gist options
  • Save jacobp100/00af55bdd7b7e7c3dd4cde6cd8d3b0b5 to your computer and use it in GitHub Desktop.
Save jacobp100/00af55bdd7b7e7c3dd4cde6cd8d3b0b5 to your computer and use it in GitHub Desktop.
const colors = require('css-color-list')()
// Returns an observable that emits a color every 10ms.
// Stops when we've gone through every color.
const getColorsObservable = () =>
Rx.Observable.interval(10)
.map(i => colors[i])
.takeWhile(color => color != null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment