https://github.com/abschill/pstyle
header-only c library for styling print statements :tada:
https://github.com/abschill/pstyle
c colors macros printf stdout
Last synced: 10 months ago
JSON representation
header-only c library for styling print statements :tada:
- Host: GitHub
- URL: https://github.com/abschill/pstyle
- Owner: abschill
- License: gpl-3.0
- Created: 2022-05-14T04:53:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-17T21:43:53.000Z (over 3 years ago)
- Last Synced: 2025-04-01T17:59:53.260Z (10 months ago)
- Topics: c, colors, macros, printf, stdout
- Language: C
- Homepage:
- Size: 24.4 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: authors
Awesome Lists containing this project
README
# pstyle
simple c library for formatting print statements
```cmd
git submodule add git@github.com:abschill/pstyle.git pstyle
```
```c
#include "pstyle/color.h"
int main() {
printf("%s%s", red.text, "Hello in Red")
}
```
## Colors Available
- `red`
- `green`
- `yellow`
- `blue`
- `purple`
- `cyan`
- `black`
## Color Constants
- `.text` - apply color to text
- `.bg` - apply color to bg
- `.bold` - bolden the text with the given color
- `.underline` - underline the text with the given color
- `.hi` - text with high intensity
- `.bhi` - bold text with high intensity
## Helper Macros
- `COLOR_RESET` - resets the terminal styles inline