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:
hs.redshift
will see significant future development.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 1400 and 6500), and each value must be a list of 3 gamma numbers between 0 and 1 for red, green and blue respectively. The table must have at least two entries (a lower and upper bound); the actual gamma values used for a given color temperature are linearly interpolated between the two closest entries; linear interpolation isn't particularly precise for this use case, so you should provide as many values as possible. Notes:
|
Signature | hs.redshift.invertSubscribe([id,]fn) |
---|---|
Type | Function |
Description | Subscribes a callback to be notified when the color inversion status changes You can use this to dynamically adjust the UI colors in your modules or configuration, if appropriate. Parameters:
Returns:
|
Signature | hs.redshift.invertUnsubscribe(id) |
---|---|
Type | Function |
Description | Unsubscribes a previously subscribed color inversion change callback Parameters:
Returns:
|
Signature | hs.redshift.isInverted() -> string or false |
---|---|
Type | Function |
Description | Checks if the colors are currently inverted Parameters:
Returns:
|
Signature | hs.redshift.requestInvert(id,v) |
---|---|
Type | Function |
Description | Sets or clears a request for color inversion Parameters:
Returns:
Notes:
|
Signature | hs.redshift.start(colorTemp,nightStart,nightEnd[,transition[,invertAtNight[,windowfilterDisable[,dayColorTemp]]]]) |
---|---|
Type | Function |
Description | Sets the schedule and (re)starts the module Parameters:
Returns:
|
Signature | hs.redshift.stop() |
---|---|
Type | Function |
Description | Stops the module and disables color adjustment and color inversion Parameters:
Returns:
|
Signature | hs.redshift.toggle([v]) |
---|---|
Type | Function |
Description | Sets or clears the user override for color temperature adjustment. This function should be bound to a hotkey, e.g.:
Parameters:
Returns:
|
Signature | hs.redshift.toggleInvert([v]) |
---|---|
Type | Function |
Description | Sets or clears the user override for color inversion. This function should be bound to a hotkey, e.g.:
Parameters:
Returns:
|