Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cor

cor is similar to the cat command, but outputs the file contents with colored hexadecimal triplets (e.g. #f00 with a red background).

Build instructions

make

How it works?

Using a terminal supporting "true color", it is possible to use these ANSI escape sequences:

ESC[38;2;⟨r⟩;⟨g⟩;⟨b⟩m Select RGB foreground color
ESC[48;2;⟨r⟩;⟨g⟩;⟨b⟩m Select RGB background color

In practice, this means that you can show the text 'TRUECOLOR' in orange in your terminal supporting "true color" this way:

printf '\033[38;2;255;100;0m%s\033[0m\n' TRUECOLOR

See also

  • cor --help
  • ap/vim-css-color: A Vim plugin to preview colors in source code while editing.

    • The inspiration for cor (which, by the way, means color in Portuguese)

About

Outputs the file contents with colored hexadecimal triplets (e.g. #f00 with a red background).

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages