setvtrgb
Set virtual terminal color palette
SYNOPSIS
setvtrgb
PARAMETERS
color_number
The color number to modify (0-15).
rrggbb
The new RGB color value in hexadecimal format (e.g., 000000 for black, ffffff for white).
DESCRIPTION
The setvtrgb command allows you to modify the color palette of a Linux virtual terminal (VT). Each virtual terminal has its own independent palette consisting of 16 colors (numbered 0 to 15). setvtrgb enables you to redefine these colors by specifying their Red, Green, and Blue (RGB) values. This command is particularly useful for customizing the appearance of text-based interfaces, improving readability, or matching color schemes across different environments. Color values are specified as hexadecimal numbers.
This command directly modifies the hardware palette registers, so its effects are usually immediate. The changes are usually not permanent across reboots unless the settings are saved using mechanisms outside the scope of setvtrgb itself (e.g., init scripts or similar configuration files).
Understanding hexadecimal notation and the structure of color definitions is crucial for effectively using setvtrgb. Incorrect usage can lead to unexpected or undesirable color results, but it will not harm your hardware. The default VGA palette is usually a good starting point when making custom color settings.
The command can only set RGB color values, it is not possible to retrieve the existing values.
CAVEATS
Changes made with setvtrgb are usually temporary and reset upon reboot. To make changes permanent, you need to incorporate the command into a startup script or configuration file. Root privileges are required to run this command.
COLOR MAPPING
The color numbers 0-15 typically correspond to standard VGA colors, but this may vary slightly depending on the hardware and system configuration:
0: Black
1: Blue
2: Green
3: Cyan
4: Red
5: Magenta
6: Brown/Yellow
7: Light Gray
8: Dark Gray
9: Light Blue
10: Light Green
11: Light Cyan
12: Light Red
13: Light Magenta
14: Yellow
15: White
SAVING CHANGES
To save setvtrgb changes persistently, consider adding the command to a script executed at system boot. The exact method depends on your init system (e.g., Systemd, SysVinit). Consult your distribution's documentation for guidance.
SEE ALSO
chvt(1)