https://github.com/shakibamoshiri/bline
beautiful line output with ANSI color code
https://github.com/shakibamoshiri/bline
ansi-colors beautiful-line
Last synced: about 2 months ago
JSON representation
beautiful line output with ANSI color code
- Host: GitHub
- URL: https://github.com/shakibamoshiri/bline
- Owner: shakibamoshiri
- License: gpl-3.0
- Created: 2018-01-11T11:24:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T13:47:31.000Z (over 7 years ago)
- Last Synced: 2025-04-15T01:52:59.537Z (8 months ago)
- Topics: ansi-colors, beautiful-line
- Language: C
- Size: 1010 KB
- Stars: 22
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

welcome to beautiful line output
A simple CLI application for testing ANSI color written in `C`.
This is an application that you can use on your Console/Terminal.
It provides you some simple + friendly + flexible options which you
can use easily. There is no prerequisite except **compile** it with a `C` compiler.
core features:
- support 3/4 bits : `ESC[Value;...;m`
- support 24 bits : `ESC[(38|48);2;...;m`
- code generation (= dump code) see the second screenshot
usage
⚫ usage
⚪ examples
⚪ NOTE
⚪ more
⚪ bottom
⚪ top
1. `git clone https://github.com/k-five/bline`
2. `cd bline/src/`
3. `make build`
usage (screenshot):
Then you have a binary file named: **bline** and you can put it in a valid path
that you have like: `/usr/bin/` or create your own path in `~/bin/` an put it
there. Or just use it in-place: `ls | ./bline -a red`
examples
⚪ usage
⚫ examples
⚪ NOTE
⚪ more
⚪ bottom
⚪ top
```
# all lines, foreground red:
ls | bline -a red
# all lines, foreground red, background green:
ls | bline -a red:green
# all lines, foreground is default (NOTE.3), background is green:
ls | bline -a :green
# add color-mode, odd lines (foreground) will be in light,italic,red
ls | bline -o light:red
# add text-mode, as well
ls | bline -o light:italic:cross:red
# combine options are okay:
ls | bline -a light:green -i red -I 7 -r yellow -R 5-10
# using hex value, foreground in red
df | bline -H -a ff00ff
# hex, foreground green, background red
df | bline -H -a 00ff00:ff0000
# hex just background
df | bline -H -a :ffff00
# look for string: 'sda' and make that/those line(s) green
lsblk | bline -m sda light:green
```
NOTE
⚪ usage
⚪ examples
⚫ NOTE
⚪ more
⚪ bottom
⚪ top
1. The app creates code dynamically. If you are interested in see: `ansi_code.h`
2. For non-HEX value it supports **color-mode** and **text-mode** and **foreground-color** and **background-color**.
3. But for HEX value it supports only **foreground-color** and **background-color**.
goal
This app have been designed mostly for educational purpose then colorizing some lines.
Although it looks like that, but I added a lot of comments so you can read the source
code easily. The two main goals in this app are:
1. how to use pointers and pointer arithmetic effectively
2. how to use heap effectively
3. how to use `bitwise` operators (see str2hex() function)
code generation example (screenshot)
For more screenshots see screenshots directory
more
⚪ usage
⚪ examples
⚪ NOTE
⚫ more
⚪ bottom
⚪ top
- [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code)
- [How to change the output color of echo in Linux](https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux/28938235#28938235)
- [ANSI escape sequences](http://ascii-table.com/ansi-escape-sequences.php)
license
⚪ usage
⚪ examples
⚪ NOTE
⚪ more
⚫ bottom
⚪ top
bline copyright © 2017 Shakiba
▒█▀▀█ ▒█▀▀█ ▒█░░░ █▀▀█
▒█░▄▄ ▒█▄▄█ ▒█░░░ ░░▀▄
▒█▄▄█ ▒█░░░ ▒█▄▄█ █▄▄█