summaryrefslogtreecommitdiff
path: root/color.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-11-20 15:25:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-11-20 20:42:49 (GMT)
commit17a4be26060b00a867cbe54ee906fe03813470ec (patch)
tree79257f8f0b06bd68a3a2783d9e44562dc2b96119 /color.h
parent695d95df19b74485be62aba0f978044ff1215ea0 (diff)
downloadgit-17a4be26060b00a867cbe54ee906fe03813470ec.zip
git-17a4be26060b00a867cbe54ee906fe03813470ec.tar.gz
git-17a4be26060b00a867cbe54ee906fe03813470ec.tar.bz2
parse_color: support 24-bit RGB values
Some terminals (like XTerm) allow full 24-bit RGB color specifications using an extension to the regular ANSI color scheme. Let's allow users to specify hex RGB colors, enabling the all-important feature of hot pink ref decorations: git log --format="%h%C(#ff69b4)%d%C(reset) %s" Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.h')
-rw-r--r--color.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/color.h b/color.h
index f5beab1..4ec34b4 100644
--- a/color.h
+++ b/color.h
@@ -9,14 +9,14 @@ struct strbuf;
* The maximum length of ANSI color sequence we would generate:
* - leading ESC '[' 2
* - attr + ';' 2 * 8 (e.g. "1;")
- * - fg color + ';' 9 (e.g. "38;5;2xx;")
- * - fg color + ';' 9 (e.g. "48;5;2xx;")
+ * - fg color + ';' 17 (e.g. "38;2;255;255;255;")
+ * - bg color + ';' 17 (e.g. "48;2;255;255;255;")
* - terminating 'm' NUL 2
*
* The above overcounts attr (we only use 5 not 8) and one semicolon
* but it is close enough.
*/
-#define COLOR_MAXLEN 40
+#define COLOR_MAXLEN 56
/*
* IMPORTANT: Due to the way these color codes are emulated on Windows,