shithub: picker

Download patch

ref: a6de205ab4f439041b54d3fcb76092efbe0bb50d
parent: d14fafde51b02db9db1d2a429112ed1535765563
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Jun 25 12:36:45 EDT 2020

apply current colorspace when switching current color

--- a/picker.c
+++ b/picker.c
@@ -601,8 +601,10 @@
 				for (c = colors; c != nil; c = c->next) {
 					if (ptinrect(m.xy, c->r)) {
 						color = c;
-						redraw();
-						goto next;
+						space->fromrgb(c->rgba, c->v);
+						for (i = 0; i < 3; i++)
+							c->v[i] = MAX(0.0, MIN(space->max[i], c->v[i]));
+						goto changed;
 					}
 				}
 			} else if (m.buttons == 4 && (i = menuhit(3, mctl, &menu2, nil)) >= 0) {