rgb-tui icon indicating copy to clipboard operation
rgb-tui copied to clipboard

Pipe color codes to stdout?

Open kflak opened this issue 2 years ago • 3 comments

Hi,

Thanks for a great program! Is there a way to get the color codes to stdout? Would love to be able to pipe it to clipboard or a file or something else entirely... Alternatively/additionally some way to export to json would be cool too.

kflak avatar Mar 09 '22 14:03 kflak

Technically, the output is written in the interface, which is displayed to stdout. There are multiple format: HEXA, RGB, HSV.

I can support pipe, so that when rgb-tui output is connected to another program, we draw the UI to the terminal output, and print the result toward the piped program.

Out of curiosity, what kind of use case do you have?

ArthurSonzogni avatar Mar 11 '22 15:03 ArthurSonzogni

My main use case is to get color values to the clipboard, so that I can put them into whatever code I am writing, whether that is in openFrameworks or my website. So an ideal scenario could look like this: press h to copy the hex values to the clipboard, r to get the rgb values, and h for hsv values. Or some other keyboard combination. Of course it could be interesting to pipe this through to other programs as well, might even be a fun way to control interactively the colors of a running program...? Just fantasizing here... but a pipe would definitely open up interesting possibilities for all kinds of applications.

EDIT: Oh wow, just discovered that you have implemented vi keybindings to navigate the color space! Awesome!

kflak avatar Mar 11 '22 19:03 kflak

I second this, getting the colors without having to type them makes this much more usable.

I also noticed that it's not possible to change the colors by changing the values directly, did I miss something?

nkh avatar Mar 01 '23 10:03 nkh

I added support for the clipboard, does it resolve this issue somehow?

ArthurSonzogni avatar Jun 02 '24 14:06 ArthurSonzogni

@ArthurSonzogni somehow but the clipboard is not stdout

nkh avatar Jun 02 '24 21:06 nkh