#hs.redshift
Inverts and/or lowers the color temperature of the screen(s) on a schedule, for a more pleasant experience at night
Usage:
-- make a windowfilterDisable for redshift: VLC, Photos and screensaver/login window will disable color adjustment and inversion local wfRedshift=hs.window.filter.new({VLC={focused=true},Photos={focused=true},loginwindow={visible=true,allowRoles='*'}},'wf-redshift') -- start redshift: 2800K + inverted from 21 to 7, very long transition duration (19->23 and 5->9) hs.redshift.start(2800,'21:00','7:00','4h',true,wfRedshift) -- allow manual control of inverted colors hs.hotkey.bind(HYPER,'f1','Invert',hs.redshift.toggleInvert)
Note:
- As of macOS 10.12.4, Apple provides "Night Shift", which implements a simple red-shift effect, as part of the OS. It seems unlikely that
hs.redshift
will see significant future development.
#API Overview
Variables - Configurable values
Functions - API calls offered directly by the extension
#API Documentation
#Variables
Signature | hs.redshift.COLORRAMP |
Type | Variable |
Description | A table holding the gamma values for given color temperatures; each key must be a color temperature number in K (useful values are between |
Notes |
|
Source | extensions/redshift/redshift.lua line 342 |
#Functions
Signature | hs.redshift.invertSubscribe([id,]fn) |
Type | Function |
Description | Subscribes a callback to be notified when the color inversion status changes |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/redshift/redshift.lua line 107 |
Signature | hs.redshift.invertUnsubscribe(id) |
Type | Function |
Description | Unsubscribes a previously subscribed color inversion change callback |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/redshift/redshift.lua line 128 |
Signature | hs.redshift.isInverted() -> string or false |
Type | Function |
Description | Checks if the colors are currently inverted |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/redshift/redshift.lua line 144 |
Signature | hs.redshift.requestInvert(id,v) |
Type | Function |
Description | Sets or clears a request for color inversion |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/redshift/redshift.lua line 161 |
Signature | hs.redshift.start(colorTemp,nightStart,nightEnd[,transition[,invertAtNight[,windowfilterDisable[,dayColorTemp]]]]) |
Type | Function |
Description | Sets the schedule and (re)starts the module |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/redshift/redshift.lua line 273 |
Signature | hs.redshift.stop() |
Type | Function |
Description | Stops the module and disables color adjustment and color inversion |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | extensions/redshift/redshift.lua line 243 |
Signature | hs.redshift.toggle([v]) |
Type | Function |
Description | Sets or clears the user override for color temperature adjustment. |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/redshift/redshift.lua line 218 |
Signature | hs.redshift.toggleInvert([v]) |
Type | Function |
Description | Sets or clears the user override for color inversion. |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | extensions/redshift/redshift.lua line 195 |