Skip to content

Instantly share code, notes, and snippets.

@jaredpalmer
Last active November 15, 2018 15:30
Show Gist options
  • Save jaredpalmer/47d905601616f84e35070ef3673671c4 to your computer and use it in GitHub Desktop.
Save jaredpalmer/47d905601616f84e35070ef3673671c4 to your computer and use it in GitHub Desktop.
Hyperterm x Philips Hue
const Hue = require('node-hue-api')
exports.decorateConfig = (config) => {
const { host, username, light } = config.hyperhue
const api = new Hue.HueApi(host, username)
api
.lightStatus(1)
.then(status => {
const { on, hue, sat, bri } = status
const color = `hsb(${hue},${sat},${bri})`
return Object.assign({}, config, {
borderColor: color,
cursorColor: color,
css: `
${config.css || ''}
.tabs_nav .tabs_list .tab_text {
color: ${color};
}
.tabs_nav .tabs_title {
color: ${color};
}
`
});
})
.catch(e => {
console.log(e)
return config
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment