sharkdp / pastel

A command-line tool to generate, analyze, convert and manipulate colors
Apache License 2.0
5.08k stars 102 forks source link

Add new escaped ANSI formats #115

Closed sharkdp closed 4 years ago

sharkdp commented 4 years ago

This changes the existing ansi-8bit and ansi-24bit formats to print out an escaped ANSI sequence that a user can see in the terminal output:

❯ pastel format ansi-8bit 556270 4ecdc4 c7f484 ff6b6b c44d58      
\x1b[38;5;59m
\x1b[38;5;44m
\x1b[38;5;192m
\x1b[38;5;203m
\x1b[38;5;131m

❯ pastel format ansi-24bit 556270 4ecdc4 c7f484 ff6b6b c44d58
\x1b[38;2;85;98;112m
\x1b[38;2;78;205;196m
\x1b[38;2;199;244;132m
\x1b[38;2;255;107;107m
\x1b[38;2;196;77;88m

This is a breaking change. The existing formats are now available as ansi-8bit-escapecode and ansi-24bit-escapecode.

This closes #113