aboutsummaryrefslogtreecommitdiffhomepage
path: root/output.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-11-09 16:42:35 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-11-09 16:42:35 -0800
commite83441395e726a01abc8df95ac996d5b4bc2f364 (patch)
tree0c86dbb37b03a245d81ce77f36cd4545027cf3de /output.h
parent43d23ee56e76f07451f725d915f243808ab3784a (diff)
Make set_color take multiple colors, and choose the best supported one
As suggested in #1323
Diffstat (limited to 'output.h')
-rw-r--r--output.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/output.h b/output.h
index ccd94645..6d1b4a01 100644
--- a/output.h
+++ b/output.h
@@ -132,6 +132,9 @@ typedef unsigned int color_support_t;
color_support_t output_get_color_support();
void output_set_color_support(color_support_t support);
+/** Given a list of rgb_color_t, pick the "best" one, as determined by the color support. Returns rgb_color_t::none() if empty */
+rgb_color_t best_color(const std::vector<rgb_color_t> &colors, color_support_t support);
+
/* Exported for builtin_set_color's usage only */
void write_color(rgb_color_t color, bool is_fg);
unsigned char index_for_color(rgb_color_t c);