Created
May 24, 2017 18:38
-
-
Save danielvlopes/235f55e5d1dbd356763eb444de3061cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hour = Meta.currentUserTime.hour() | |
const colorKey = hour.toString() | |
const colors: {[key:string]:string} = { | |
"17":"#F3F2EB", | |
"18":"#F7F2E6", | |
"19":"#F9EFE0", | |
"20":"#FBEFDC", | |
"21":"#FBE5C6", | |
"22":"#FBE5C6" | |
} | |
if (hour < 17) { | |
Lifx.color.skip("Too early") | |
} else if (hour < 22) { | |
Lifx.color.setAdvancedOptions( | |
`color: ${colors[colorKey]}; brightness: 1; duration: 12` | |
) | |
} else { | |
Lifx.color.skip("Too late") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment