mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-14 17:41:45 +04:00
Fix highlighted text not readable with some color schemes
Make the foreground (text) color be the usual background color, when highlighting text. This is done by setting the foreground color instead of the background color, then inverting (code 7) to swap the foreground and background colors. Previously, with some color schemes there was not enough contrast between the text and highlight color. Based on the assumption that there should be contrast between terminal colors and the background, this should make the text readable with a wider set of color schemes.
This commit is contained in:
parent
86300a4a7e
commit
b6c3bf3763
1 changed files with 4 additions and 4 deletions
|
|
@ -56,10 +56,10 @@ if sys.platform == 'win32': # pragma: no cover (windows)
|
|||
else: # pragma: win32 no cover
|
||||
terminal_supports_color = True
|
||||
|
||||
RED = '\033[41m'
|
||||
GREEN = '\033[42m'
|
||||
YELLOW = '\033[43;30m'
|
||||
TURQUOISE = '\033[46;30m'
|
||||
RED = '\033[31;7m'
|
||||
GREEN = '\033[32;7m'
|
||||
YELLOW = '\033[33;7m'
|
||||
TURQUOISE = '\033[36;7m'
|
||||
SUBTLE = '\033[2m'
|
||||
NORMAL = '\033[m'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue