A python script to change Hue lightbulb colors based on what's displayed on the screen. [Mac].
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
AmbienceHue.py Updated readme Jul 30, 2017
README.md Updated readme Jul 30, 2017



A python script that continuously changes Hue lightbulb colors based on what's displayed on the screen. This script uses the Quartz.CoreGraphics module, which is Mac specific.


Demo video

How to use


  • macOS with Xcode & command line tools installed. Tested with macOS 10.12 (Sierra).

  • Quartz.CoreGraphics python module

     pip install -U pyobjc-core
     pip install -U pyobjc
  • PHue python module

     pip install phue
  • AmbienceHue code

     git clone git@github.com:G2Jose/AmbienceHue.git


  • Change the value of BRIDGE_IP to the IP address of your Hue Bridge. You can find this by logging into your Router's admin page.
  • Change the LEFT_LIGHT and RIGHT_LIGHT parameters to match your setup. This might require some trial to figure out what numbers map to what lights.
  • The transition time is set to 0.1 ds (0.1 * 1/10th of a second) to avoid the appearance of the lights flickering.
  • By default, the script only watches a strip 1/20th the width of the screen on each side. This setting can be changed by modifying the WIDTH parameter.


  • Navigate to the directory containing the script

     cd AmbienceHue
  • Launch the script using python (tested on 3.5.2)

     python AmbienceHue.py

In case of bugs or issues, get in touch through www.georgejose.com or file a github issue!