https://github.com/levy-y/jcolor
A simple Java lib, for colored terminal output
https://github.com/levy-y/jcolor
formatting java-util output terminal-coloring
Last synced: about 1 year ago
JSON representation
A simple Java lib, for colored terminal output
- Host: GitHub
- URL: https://github.com/levy-y/jcolor
- Owner: Levy-Y
- Created: 2024-08-16T10:37:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-16T11:01:08.000Z (over 1 year ago)
- Last Synced: 2025-01-08T23:59:31.791Z (about 1 year ago)
- Topics: formatting, java-util, output, terminal-coloring
- Language: Java
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JColor
### Method:
```java
printc(Styles style, String string)
```
This method prints a formatted string to the console based on the specified style. The Styles enum defines various styles such as colors, boldness, underlining, background colors, and brightness.
Parameters:
- Styles style: The style to apply to the printed text.
- String string: The text to be printed.
Styles Options:
- BLACK, RED, GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE
- Bold versions of the above (BLACK_BOLD, etc.)
- Underlined versions of the above (BLACK_UNDERLINED, etc.)
- Background color versions of the above (BLACK_BACKGROUND, etc.)
- Bright versions of the above (BLACK_BRIGHT, etc.)
- Combined versions like bold and bright (BLACK_BOLD_BRIGHT, etc.)
Example Usage:
```java
import com.example.CString;
public class Main {
public static void main(String[] args) {
CString.printc(Styles.RED, "Hello, World!");
}
}
```
In this example, the text "Hello, World!" will be printed in red.