https://github.com/vieitesss/colorize-java
A minimal library to print colored text in Java console
https://github.com/vieitesss/colorize-java
color console java library text
Last synced: 5 months ago
JSON representation
A minimal library to print colored text in Java console
- Host: GitHub
- URL: https://github.com/vieitesss/colorize-java
- Owner: vieitesss
- License: mit
- Created: 2023-12-07T16:17:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-11T17:20:23.000Z (over 1 year ago)
- Last Synced: 2023-12-11T18:34:40.564Z (over 1 year ago)
- Topics: color, console, java, library, text
- Language: Java
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Colorized Java
This is a really simple library that I developed to print colored text whitin the Java console.
The need appears while I was working on an assigment and I wanted to print colored text. I did not find any library that does this in the first searches on the Internet, so I decided to create it myself.
So know, instead of surfing the web for ANSI codes every time I need colored text for Java, I have got this library ready to go. Keeping it stored is a no-brainer, no need spend time searching for ANSI codes online.
## Usage
1. Download the .jar
```shell
wget https://github.com/vieitesss/colorize-Java/blob/main/Color.jar
```2. Add the library to your classpath.
3. Import it like this:```java
import color.Color;
```4. Now you can print colored text in your console:
```java
public class Example{
public static void main(String[] args) {
System.out.prinln(Color.colorize(COLOR_RED, "Hello world in red!"));
System.out.prinln("This is " + Color.colorize(COLOR_YELLOW, "yellow"));
System.out.prinln(Color.colorize(COLOR_GREEN, "Green") + " is also available");
}
}
```## More
Feel free to download even the .jar or the source code.
If you like it leave a ⭐️