]> git.ipfire.org Git - thirdparty/git.git/commit
color.c: refactor color_output arguments
authorEyal Soha <shawarmakarma@gmail.com>
Tue, 21 Jan 2020 16:56:21 +0000 (08:56 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Feb 2020 19:07:39 +0000 (11:07 -0800)
commit4a28eb0ae4fc666291a6a6f84a0605ccb9279278
treecc53dbe9a38bb7f8ec8907a59625f54fe9b4d898
parentd0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783
color.c: refactor color_output arguments

color_output() takes a "type" parameter, which is either '3' or '4',
and that byte is shown in front of '0'-'7' to form "30"-"37" or
"40"-"47" in ANSI output mode for fore-ground and back-ground
colors.

Clarify the purpose of the parameter by renaming it to the
"background" that is a boolean.

Also, change the .value field in the color struct from storing 0-7
for basic 8 colors to storing 30-37 for ANSI colors.  This aligns
the code to show ANSI colors to the code for the 256 color scheme,
which already uses the actual value to be sent to the terminal.

Signed-off-by: Eyal Soha <shawarmakarma@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
color.c