0

When i select the dark colors they get inverted to a color that don't applies to the console. If i select dark yellow "rgb 0 128 128" it inverts to a light blue "rgb 127 127 255" color, that color is not a standard color and can't be used by ordinary methods like,

SetConsoleTextAttribute, ANSI.SYS \033[1;34m

It would help me so much if i could get the answer.

Thanks! :)

Picture Of The Colors

HardCoded
  • 134
  • 2
  • 8

1 Answers1

0

The question is: how to make colors of selected-cells on a console window look like some reversed version (e.g., foreground and background switching) of the unselected colors.

This behavior is built into the console window (or more generally, a terminal). There is no escape sequence or other documented feature of console windows which can do this.

In the more general sense, this aspect is different on various terminals. xterm for example can:

  • exchange foreground and background colors, or
  • use specific colors for the selected text.

xterm does this by mapping between different items in its color table.

Some other terminal may implement the color change by XOR'ing the color value, mapping 0 to 255 and 255 to 0 (white/black). This is very simple to implement. However, for colors other than white and black, it produces an effect like that shown in your picture.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • +1 i remember i glitched in the cmd on my last computers so i had multiple selections. Could i make a program that selects different locations to get the 24 colors? – HardCoded Jan 06 '16 at 11:47
  • probably not (I don't recall any console/terminal implementations which use more than one selection-coloring at the same time). – Thomas Dickey Jan 08 '16 at 09:16