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
256 { nil, nil, CHANEND },256 { nil, nil, CHANEND },
257 };257 };
258 Color *c;258 Color *c;
259 char *s;259 char *s, buf[16];
260 vlong v;260 vlong v;
261 int i, j;261 int i, j;
262 262
@@ -356,6 +356,12 @@ next: · 93 unmodified lines
356 c->v[i] = MIN(mode->max[i], (double)(m.xy.x - r.min.x) * mode->max[i]/(double)(Dx(r)-1));356 c->v[i] = MIN(mode->max[i], (double)(m.xy.x - r.min.x) * mode->max[i]/(double)(Dx(r)-1));
357 mode->torgb(c->v, c->rgba);357 mode->torgb(c->v, c->rgba);
358 c->u = D2C(c->rgba[0])<<24 | D2C(c->rgba[1])<<16 | D2C(c->rgba[2])<<8 | D2C(c->v[3]);358 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;
359 redraw();365 redraw();
360 goto next;366 goto next;
361 }367 }

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