Overview


Colour Filter is a night light and colour filtering app for Linux. It can change the colour balance based on the time of day, or add arbitrary colour filtering based on user preference.



Colour Filter on GitHub →

Design and Implementation


In recent years the effects of screen time on sleep have become well known. Exposure to blue light late at night can disturb circadian rhythms, so it is now common for PCs and phones to have 'night-light' apps to filter blue light. I use these on all of my devices, however I could not find a suitable one for a lightweight Linux build, and so decided to make my own.

The app was written in C to minimize resource usage. It uses the GTK library for visual integration with other native Linux apps. The UI is utilitarian by design, in fitting with the target platform. I chose to enable the filter based on a user-set time rather than based on sunset time, since this is my preferred functionality. The colour balance of the filter can also be fully customized. A slight reduction in green along with the blue reduction can create a more natural warm effect, and so users can adjust the red, green, and blue values separately to achieve the desired balance. The filter can also adjust the screen brightness.

The app changes system-wide settings directly on the display server. Extreme care had to be taken to ensure undesirable settings were not applied, and that default settings were reapplied correctly on exit. Most users have no way of accessing these settings, so any errors could only be undone with a full system reset. Extensive testing for undesirable behaviour was undertaken to ensure necessary failsafes were implemented.