aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-22 20:18:55 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-22 20:18:55 +0000
commitf96eb5ff074dff8c9c9dce63886a94875604901c (patch)
tree707abc7215660c74225b760d1a1ff26aef73ea4a /sixel.c
parentsixel: add comments to max_width()/max_height() (diff)
sixel: add HLS color format support
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sixel.c b/sixel.c
index be21d263..7b1c8646 100644
--- a/sixel.c
+++ b/sixel.c
@@ -6,6 +6,7 @@
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "render.h"
+#include "sixel-hls.h"
#define ALEN(v) (sizeof(v) / sizeof(v[0]))
#define max(x, y) ((x) > (y) ? (x) : (y))
@@ -346,8 +347,10 @@ decgci(struct terminal *term, uint8_t c)
switch (format) {
case 1: { /* HLS */
- LOG_ERR("HLS color format not implemented");
- assert(false && "HLS color format not implemented");
+ uint32_t rgb = hls_to_rgb(c1, c2, c3);
+ LOG_DBG("setting palette #%d = HLS %hhu/%hhu/%hhu (0x%06x)",
+ term->sixel.color_idx, c1, c2, c3, rgb);
+ term->sixel.palette[term->sixel.color_idx] = rgb;
break;
}