Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.
/ cor Public archive

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

License

Notifications You must be signed in to change notification settings

danielsource/cor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published