summaryrefslogtreecommitdiff
path: root/src/haikuterm.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-05-18 12:36:50 +0000
committerPo Lu <luangruo@yahoo.com>2022-05-18 12:37:54 +0000
commitd5540d7dbcee2a35dc928670ac210c5ffb909a75 (patch)
tree45abcbd2fcb4c2ba71ee25389834e5d29ec869ab /src/haikuterm.c
parent3faba1dff6fa340033071e92309a1b112d58a7fa (diff)
downloademacs-d5540d7dbcee2a35dc928670ac210c5ffb909a75.tar.gz
Implement gamma-correction on Haiku
* src/dispextern.h: Add `gamma_correct' prototype on Haiku as well. * src/haikufns.c (gamma_correct): New function. * src/haikuterm.c (haiku_defined_color): Gamma-correct colors if their pixels are being allocated.
Diffstat (limited to 'src/haikuterm.c')
-rw-r--r--src/haikuterm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/haikuterm.c b/src/haikuterm.c
index af20d1c11c8..2db1e352ffb 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -575,7 +575,14 @@ static bool
haiku_defined_color (struct frame *f, const char *name,
Emacs_Color *color, bool alloc, bool make_index)
{
- return !haiku_get_color (name, color);
+ int rc;
+
+ rc = !haiku_get_color (name, color);
+
+ if (rc && f->gamma && alloc)
+ gamma_correct (f, color);
+
+ return rc;
}
/* Adapted from xterm `x_draw_box_rect'. */