OmarTawfik / terminal-screenshot

Render terminal ANSI output into images!
MIT License
9 stars 2 forks source link

feat: add color scheme support #11

Open edouard-lopez opened 9 months ago

edouard-lopez commented 9 months ago

fixes: #8

This is based on #10 as I updated the main dependencies to their latest version.

Available color schemes come from https://github.com/ysk2014/xterm-theme/blob/master/src/index.js#L313.

Usage

Command Screenshot
fish_prompt \
| node out/src/cli.js -o cli.png -c "Tomorrow"
fish_prompt \
| node out/src/cli.js  -o cli.png
edouard-lopez commented 9 months ago

I'm puting this one on draft until you merge the other one #10, #12 and #14

edouard-lopez commented 8 months ago

Good idea. Maybe we can add an options.theme to replace options.backgroundColor .. I suggest accepting the xterm's theme object (link). I'm a bit skeptic about depending on the xterm-theme package. It is a 5 years old package with no real usage or known contributors. But the suggestion above would permit users of terminal-screenshot to leverage xterm-theme if they want, and forward its data along. @OmarTawfik

I change the approach to above

edouard-lopez commented 7 months ago

@OmarTawfik I rebase the PR and expect a file path option to define the color scheme. Also went back to the color scheme nomenclature to avoid cli conflict with --type