Colourize allows you to easily colourise text streams based on specified string patterns. It is designed to provide a simple yet powerful way to add custom colors to different parts of your text.
The program looks for specific strings specified after certain arguments such as --after
, --from
, and --reset-on
and formats them with the specified color. Here's an example:
stat image.png | clr red --after ": " green --reset-on " "
This command outputs the standard input in red. After encountering :
, it formats the subsequent string in green. It then resets to red after encountering two consecutive spaces
.
By default, the color definitions are read from ~/.config/colourize/preset
.
stat README.md | clr bright_red --after Access: 55ccff
Valid colours include hexadecimal colours and black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
, bright_black
, bright_red
, bright_green
, and so on.
To customize color presets, you can modify the configuration file located at ~/.config/colourize/preset
. This file defines the default color mappings.
Make sure you have libclr installed. Then run ./install.sh
.
- fix kmp implementation
- config file support
-
--match
option; only colour matching string
Note: The tool is currently under development, and improvements are ongoing.