History

write new colors to stdout

Sigrid Haflínudóttir committed 6 years ago

Commit e6ae8d21 parent ffd44881 file · +7 −1Browse files

Unified · Split

picker.c+7−1
@@ -256,7 +256,7 @@ threadmain(int argc, char **argv) · 255 unmodified lines
256256 { nil, nil, CHANEND },
257257 };
258258 Color *c;
259− char *s;
259+ char *s, buf[16];
260260 vlong v;
261261 int i, j;
262262
@@ -356,6 +356,12 @@ next: · 93 unmodified lines
356356 c->v[i] = MIN(mode->max[i], (double)(m.xy.x - r.min.x) * mode->max[i]/(double)(Dx(r)-1));
357357 mode->torgb(c->v, c->rgba);
358358 c->u = D2C(c->rgba[0])<<24 | D2C(c->rgba[1])<<16 | D2C(c->rgba[2])<<8 | D2C(c->v[3]);
359+ if (nchan < 4)
360+ j = sprint(buf, "%d %06lux\n", curcolor, c->u>>8);
361+ else
362+ j = sprint(buf, "%d %08lux\n", curcolor, c->u);
363+ if (write(1, buf, j) != j)
364+ goto end;
359365 redraw();
360366 goto next;
361367 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t