Chapter 3. Colors | FreeBSD Documentation Portal
Description: Features to set up colors
Keywords: Accessibility,High contrast,Color blindness,Theming

# Chapter 3. Colors

## 3.1. Introduction

This chapter explains how to configure colors for on-screen elements, including:

- Setting high-contrast color schemes in graphical environments.

- Adapting screen color temperature for optimal viewing in daylight and nighttime conditions.

- Selecting colors for configuration ports menus.

## 3.2. High Contrast Theme

Graphical Environments allow you to easily install and set up graphical themes. This paragraph describes how to configure high contrast themes for windows.

### 3.2.1. KDE Plasma

Launch the `Global Theme` module:

    % kcmshell6 kcm_lookandfeel

The window shows the current installed themes. Click on the "Get New…​" icon in the top right corner. A new window will show additional themes available for installation. In the search field at the top right, you can look for new themes to install. You can search for "high contrast" or "Acrilic Dark".

### 3.2.2. XFCE

Download from High Contrast Windows 11 Themes:

- Adwaita-Dusk.tar.bz2

- Adwaita-Desert.tar.bz2

- Adwaita-Aquatic.tar.bz2

- Adwaita-NightSky.tar.bz2

The example is for NightSky, but of course you can choose whichever theme you prefer.

    % tar xzvf Adwaita-NightSky.tar.bz2 (1)
    % mkdir ~/.themes (2)
    % cp -a Adwaita-NightSky ~/.themes/ (3)
    % rm Adwaita-NightSky.tar.bz2 (4)
    % xfconf-query -c xfwm4 -p /general/theme -s 'Adwaita-NightSky' (5)
    % xfconf-query -c xsettings -p /Net/ThemeName -s 'Adwaita-NightSky' (6)

1 | Extract the downloaded theme archive.
2 | Create the ~/.themes directory if it does not already exist.
3 | Copy the extracted themes into ~/.themes.
4 | Optionally, delete the original compressed file to save space.
5 | Apply the Adwaita-NightSky theme for the XFCE desktop environment.
6 | Apply the Adwaita-NightSky theme for GTK applications.

The theme selection steps (5 and 6) can also be performed using the graphical configuration dialogs in XFCE:

    % xfwm4-settings
    % xfce4-appearance-settings

## 3.3. High Contrast Icons

Graphical Environments allow you to easily install and set up icon themes. This paragraph describes how to configure high contrast icons.

### 3.3.1. KDE Plasma

Open the `Icons` module:

    % kcmshell6 kcm_icons

The window displays the currently installed icon themes. To install a new theme, click the `Get New…​` icon in the top right corner. A new window will appear, allowing you to browse and install additional icon themes. As a suggestion, you can search for `Treepata` using the search bar at the top right. Although originally designed for XFCE and later adapted for KDE Plasma, Treepata was created as a high-contrast accessibility theme.

### 3.3.2. XFCE

Run the following commands to use the Treepata - High Contrast icons theme with XFCE.

Download Treepata.zip from Treepata - High contrast. Then execute:

    # pkg search zip (1)
    % unzip Treepata.zip (2)
    % mkdir ~/.icons (3)
    % cp -a Treepata ~/.icons/ (4)
    % rm Treepata.zip (5)
    % xfconf-query -c xsettings -p /Net/IconThemeName -s Treepata (6)

1 | Install the package archivers/zip:
2 | Extract the downloaded archive file.
3 | Create the ~/.icons directory if it does not already exist.
4 | Copy the extracted theme into ~/.icons.
5 | Optionally, delete the downloaded archive file to free up space.
6 | Set the Treepata icon theme.

The icon theme (step 6 above) can also be set graphically via the `Appearance` dialog under the `Icons` tab. To do so, open the dialog and select your preferred icon theme:

    % xfce4-appearance-settings

| If you have icon theme problems, install misc/hicolor-icon-theme and graphics/gtk-update-icon-cache:
    # pkg install hicolor-icon-theme gtk-update-icon-cache
Run gtk-update-icon-cache(1) to create or update the icon cache:
    % gtk-update-icon-cache -f -t ~/.icons/treepata

## 3.4. Color temperature

This paragraph explains various utilities that adjust screen colors based on temperature, day/night cycles, and gamma settings. These utilities enable both interactive color adjustments and automatic changes based on the local time and geographical location. Some utilities are compatible with the X Window System, others support Wayland, and some work on both display servers.

Table 1. Color Temperature Utilities
Name | Auto Update | Environment | Package
--- | --- | --- | ---
darkman | Yes | X11 | accessibility/darkman
gammastep | Yes | X11 | accessibility/gammastep
Night Light | Yes | KDE Plasma | x11/kde
redshift | Yes | X11, Wayland | accessibility/redshift
sct | No | X11 | accessibility/sct
sctd | Yes | X11 | accessibility/sctd
wlsunset | Yes | Wayland | accessibility/wlsunset

The rest of this section details the steps to install, configure, and launch the utilities.

### 3.4.1. darkman

darkman(1) is a daemon that automatically manages transitions between dark mode and light mode. It operates primarily in the background, switching the screen’s color scheme based on the local time of the current location. To install, run:

    # pkg install darkman

Create the file ~/.config/darkman/config.yaml and write your latitude and longitude. Example:

    lat: 37.52
    lng: 122.16

The utility does not directly change the screen colors; instead, it calls external utilities to perform the color transitions. Add scripts to be executed at sundown by placing them in $XDG_DATA_DIRS/dark-mode.d/ and scripts to be executed at sunrise by placing them in XDG_DATA_DIRS/light-mode.d/. Several example scripts are available in the project repository.

To start darkman manually, run:

    % darkman run &

The utility also offers some interactive options; for more details refer to the darkman(1) manual page.

### 3.4.2. gammastep

The gammastep(1) utility adjusts your screen’s color temperature automatically based on your location. To install, run:

    # pkg install gammastep

The utility works out of the box without any configuration. Simply start it by running:

    % gammastep &

| If you encounter any issues, customize the configuration by adapting the gammastep.conf.sample file and save it as ~/.config/gammastep/conf.ini. Refer to the README for troubleshooting.

### 3.4.3. KDE Plasma

KDE allows you to adjust the screen color temperature based on geographic location and local time. Launch the `Night Light` module:

    % kcmshell6 kcm_nightlight

Enable automatic color adjustment by selecting the desired option from the `Switching times` drop-down menu.

### 3.4.4. redshift

The redshift(1) utility find your position and sets the color temperature accordingly. To install, execute:

    # pkg install redshift

The redshift utility runs without any configuration. To start it, simply execute:

    % redshift &

The utility might hang while trying to determine the location or the correct method to set the color. In this case, specify them explicitly using `-l latitude:longitude` and `-m method`. The available methods can be listed by running: `% redshift -m list`.

Example of running redshift with an explicit location and method:

    % redshift -l 37.86:-122.27 -m randr &

To make this setting permanent, add the following lines to ~/.config/redshift/redshift.conf file:

    [redshift]
    adjustment-method=randr
    location-provider=manual

    [manual]
    lat=37.86
    lon=-122.27

| The project provides a default redshift.conf.sample configuration file. For troubleshooting and additional information, please refer to the README.

### 3.4.5. sct

The sct(1) utility is a simple command-line tool for controlling screen color temperature. It does not update automatically and must be run repeatedly to adjust the temperature over time. To install, execute:

    # pkg install sct

The utility takes temperature values between 1000 and 10000, 6500 is the default. To run sct, type: `sct value`:

    % sct 8000

| The utility suggests 3 styles: 1) Campfire style
    % sct 4500
2) Dust storm on Mars style
    % sct 2000
3) Coffee free all nighter style
    % sct 8000

### 3.4.6. sctd

The sctd utility calculates sunrise and sunset times based on latitude and longitude, and adjusts the screen’s color temperature accordingly. To install, run:

    # pkg install sctd

To run sctd, specify your location using the `--latitude` and `--longitude` options:

    % sctd --latitude 40.55 --longitude 14.34 &

To reset the screen color to default, run:

    % sctd --reset

### 3.4.7. wlsunset

The wlsunset(1) utility is a Day/Night gamma adjustments for Wayland compositors.

To install, execute:

    # pkg install wlsunset

To start the utility type `wlsunset -l latitude -L longitude`. Example:

    % wlsunset -l 14.34 -L 40.55 &

## 3.5. Ports Collection

FreeBSD provides the Ports Collection, which offers a simple way to install applications. Some ports allow you to configure options before building and installation. By default, configuration is handled through a TUI menu built by the ports-mgmt/portconfig. The colors can be customized in several ways:

1. Terminal color capabilities.

2. The $NO_COLOR environment variable.

3. The $PORTCONFIG_THEMEFILE environment variable.

4. The global /usr/local/etc/portconfig/theme.conf file.

| These methods are listed in order of decreasing priority and are mutually exclusive, meaning only one can be active at a time.

1. Terminal Colors

portconfig(1) automatically detects whether the terminal supports colors. If not, it defaults to a black-and-white theme.

2. NO_COLOR

If the `$NO_COLOR` environment variable is set and not empty, portconfig forces the black-and-white theme

Example 1. Example persistent setting `$NO_COLOR`

/etc/make.conf

    export NO_COLOR=YES

3. PORTCONFIG_THEMEFILE

If the `$PORTCONFIG_THEMEFILE` environment variable is set and points to a valid theme file, it will be used. Otherwise, the default theme is applied.

Example 2. .Example persistent setting `$PORTCONFIG_THEMEFILE`

/etc/make.conf

    export PORTCONFIG_THEMEFILE=/home/foo/mytheme.conf

| To create a new theme file, run:
    % /usr/local/bin/bsddialog --save-theme mytheme.conf --infobox "Saving theme..." 0 0

4. Global theme.conf

If the file /usr/local/etc/portconfig/theme.conf exists and is valid, it will be used. If not, the default theme is applied.

| Sample themes are included in /usr/local/etc/portconfig/: blackwhite.conf default.conf red-green.conf yellow-blue.conf To use the yellow-blue.conf theme:
    # ln -s /usr/local/etc/portconfig/yellow-blue.conf /usr/local/etc/portconfig/theme.conf

## 3.6. Brightness

Screen brightness can be adjusted in various ways. The available methods depend heavily on the hardware, so it’s recommended to try the features described in the following sections.

### 3.6.1. backlight

The backlight(8) utility is included with the operating system. It is used to set the brightness of devices located under /dev/backlight/.

The command `backlight -f device value` sets the brightness of device to value, where value is an integer between 0 (dim) and 100 (bright). If no device is specified, the default device /dev/backlight/backlight0 is considered.

Example for setting the brightness of the default device to 50%:

    % backlight 50

| Unless the user belongs to the "video" group, the command needs to run as root.

### 3.6.2. acpi_video

The acpi_video(4) driver, included with the operating system, uses the ACPI Video Extensions to control display switching and backlight brightness. To load the kernel module, run:

    # kldload acpi_video

Brightness settings can be configured using sysctl(8). The following parameters are available:

- hw.acpi.video.device.levels: List of supported brightness levels.

- hw.acpi.video.device.brightness: Current brightness level of the device.

device is a possible display device. Example to set the brightness to 50% for the lcd0 device:

    % sysctl hw.acpi.video.lcd0.brightness (1)
    hw.acpi.video.lcd0.brightness: 90
    % sysctl hw.acpi.video.lcd0.levels (2)
    hw.acpi.video.lcd0.levels: 90 60 2 4 6 8 10 12 14 16
    18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52
    54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88
    90 92 94 96 98 100
    # sysctl hw.acpi.video.lcd0.brightness=50 (3)
    hw.acpi.video.lcd0.brightness: 90 -> 50

1 | `sysctl hw.acpi.video.device.brightness` to view the current brightness level.
2 | `sysctl hw.acpi.video.device.levels` to view the available levels.
3 | `sysctl hw.acpi.video.device.brightness=50` to set the brightness to 50.

| acpi_video(4) should be loaded after any of the DRM kernel modules.

### 3.6.3. xbrightness

The x11/xbrightness utility can change the brightness via the X Window System.

    # pkg install xbrightness

The xbrightness(1) utility allows to set a value between 0 (darkness) and 65535 (full brightness). Example for setting brightness to 50%:

    % xbrightness 32767

### 3.6.4. xrandr

The x11/xrandr package is an extension of the X11 server that provides the xrandr(1) utility. It allows you to configure various display properties, including brightness. To install execute:

    # pkg install xrandr

The command `xrandr --output monitor --brightness brightness` allows you to set the brightness for monitor to a value between 0 and 1.0. To list the available monitors, run:

    % xrandr --listmonitors
    Monitors: 2
     0: +HDMI-1 1920/598x1080/337+0+0  HDMI-1
     1: +eDP-1 1920/344x1080/194+1920+0  eDP-1

Example for setting brightness to 50% for HDMI-1:

    % xrandr --output HDMI-1 --brightness 0.5

## 3.7. Color Blindness

This section describes how to use utilities designed for color blindness.

### 3.7.1. KDE Plasma

KDE allows you to filter colors for graphical elements. Launch the `Accessibility` module:

    % kcmshell6 kcm_access

In the navigation pane, select `Color Blindness Correction`. Enable the `Color blindness correction` option, then choose the appropriate color transformation mode from the `Mode` drop-down menu.

Last modified on: November 24, 2025 by Alfonso S. Siciliano

Prev
Home
Next