Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

You may find this question/answer helpful as well: RGB values of the colors in the Ansi extended colors index (17-255)RGB values of the colors in the Ansi extended colors index (17-255)

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

You may find this question/answer helpful as well: RGB values of the colors in the Ansi extended colors index (17-255)

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

You may find this question/answer helpful as well: RGB values of the colors in the Ansi extended colors index (17-255)

add link
Source Link
Thomas Dickey
  • 79.3k
  • 9
  • 189
  • 290

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

You may find this question/answer helpful as well: RGB values of the colors in the Ansi extended colors index (17-255)

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.

You may find this question/answer helpful as well: RGB values of the colors in the Ansi extended colors index (17-255)

Source Link
Thomas Dickey
  • 79.3k
  • 9
  • 189
  • 290

The short answer is that you can find on the web tables of colors and match them up to the color number.

The long answer is that the correct mapping depends on the terminal —

The 125 is a parameter to an escape sequence referred to as setaf in the terminal description. tput attaches no particular meaning to the number. That actually depends upon the particular terminal emulator.

A while back, ANSI defined codes for 8 colors, and there were two schemes for numbering those. The two are seen in some terminal descriptions as the pairs setf/setb or setaf/setab. Since the latter has the connotation of "ANSI colors", you will see that used more often. The former (setf/setb) switched the order for red/blue as noted in the ncurses FAQ Why are red/blue interchanged?, but in either case, the scheme was established for just numbering the colors. There is no predefined relationship between those numbers and RGB content.

For specific terminal emulators, there are predefined color palettes which can be enumerated easily enough — and can be programmed using these escape sequences. There are no relevant standards, and you will see differences between terminal emulators, as noted in the xterm FAQ I don't like that shade of blue.

However, convention is often confused with standards. In development of xterm over the past 20 years, it incorporated ANSI (8) colors, adapted the aixterm feature (16) colors, added extensions for 88- and 256-colors. Much of that has been adopted by other developers for different terminal emulators. That is summarized in the xterm FAQ Why not make "xterm" equated to "xterm-256color"?.

The xterm source-code includes scripts for demonstrating the colors, e.g., using the same escape sequences that tput would use.