Terminal - Color

Card Puncher Data Processing

About

Color in a terminal are managed through a sequence of characters called an escape sequence that is added to your text as suffix (before) and interpreted by the terminal as command.

Example

Characters that needs to be rendered as black character on a white background should start with the following sequence (3/4 bit color sequence)

ESC[30;47m

where:

  • ESC[…m is the sequence
  • 30 means black in the foreground
  • and 47 means white in the background

Library

3/4bit

The encoding of color representation on 3/4 bits.

Escape Sequence

ESC[{attr1};...;{attrn}m

where:

  • ESC is the escape character
  • [ stands for itself
  • {attr1};…;{attrn} is the sequence of attributes defined below
  • m stands for itself

Attributes

Head Attributes

Head Attributes
0 Reset all attributes
1 Bright
2 Dim
4 Underscore
5 Blink
7 Reverse
8 Hidden

Foreground Colours Attributes

Foreground Colours Attributes
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White

Background Colours Attributes

Background Colours Attributes
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White

Documentation / Reference





Discover More
Card Puncher Data Processing
Dos - Echo

Displays messages, or turns command-echoing on or off. escape Just add the special characters bracket or period just after the echo command You can echo in color with color terminal escape sequence...
Init - How to develop a SysV Init Script

How to develop an init script is the service name. /var/lock/subsys/ contains the lock files created by the init scripts Library: On Redhat, a library /etc/init.d/functions contains the standard...
Javascript Console Dir
Javascript - (Console) Logging

logging in javascript are functions of the console Console logging permits inspecting a Web application (page). window Level Shows All Shows all console output Errors Only show output from...
Card Puncher Data Processing
OS - Terminal (Emulator) (Term|tty)

A terminal is a media using a fixed-pitch character grid such as: teletypes, portable devices with limited display capabilities bank terminal text based such as console but also graphical...
Card Puncher Data Processing
Os - Shell

This page is shell in an OS context A shell is a command line interpreter for OS Command. In a more detailed way, a shell is: an interactive application providing a read-eval-print loop environment...
Card Puncher Data Processing
Terminal - Escape Sequence (Control sequence)

An escape sequence is a sequence of characters that is interpreted by the terminal as a command. Example: change the text color move the cursor ... They change the state of computers and their...



Share this page:
Follow us:
Task Runner