From a418521ced195562c00b49a7676d9396eaf8189f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 22 Feb 2020 11:37:25 +0100 Subject: [PATCH] sixel: mention why we add one --- sixel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sixel.c b/sixel.c index 0656e4c1..7e547822 100644 --- a/sixel.c +++ b/sixel.c @@ -309,8 +309,10 @@ decgci(struct terminal *term, uint8_t c) int nparams = term->sixel.param_idx; - if (nparams > 0) + if (nparams > 0) { + /* Add one, as we use idx==0 for background color (TODO) */ term->sixel.color_idx = min(1 + term->sixel.params[0], COLOR_COUNT - 1); + } if (nparams > 4) { unsigned format = term->sixel.params[1];