Skip to content

jihedkdiss/jColors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

jColors 🎨 Library

Colorful output library for Java
Explore the repository »

View Code · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Compiling
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

jColors Screenshot

jColors is a lightweight Java library to make printing colored output to the console super easy. Unlike many libraries that provide this feature but with hard syntax or limited abilities, jColors provides you with full capabilities. The library is fully coded in Java and the syntax is easy to understand and very intuitive.

Features

  • Runs on any type of console/terminal (even cmd on Windows out of the box!)
  • Easy to integrate with your projects, just add the necessary .jar files and you're all set!
  • Wide range of styles, colors and background colors!
  • You can read input in colors and styles as well! (not only output)
  • You can make your own combinations (use many styles together)

Available styles

  • Styles: normal, bold, underline, inverse.
  • Foreground colors: black, red, green, yellow, blue, magenta, cyan, white (+ strong variations)
  • Background colors: black, red, green, yellow, blue, magenta, cyan, white (+ strong variations)
  • Input colors: black, red, green, yellow, blue, magenta, cyan, white

You can try run the Main.java program to get a look at all available styles in action.

Built With

(back to top)

Getting Started

jColors is simple and easy to use by design. Setting up jColors in your project takes only a few clicks, and you'll enjoy hundreds of styles.

Prerequisites

This library relies on the JNA (Java Native Access) library. Make sure to download JNA and add it to your classpath before running jColors in your project.

  • jna-version.jar
  • jna-platform-version.jar

Installation

To integrate jColors in your project, you can either add the .jar files to your IDE or add them to your classpath if you want to compile it by yourself.

  1. Import jColors
    import jcolors.*;
  2. Setup Windows CMD compatibility (optional)
    jcolors.setup();
  3. Print your first colored output!
    System.out.println(fgColors.yellow("We did it!!"));
  4. Read your first colored input!
    inputColorsStrong.cyan();
    System.out.print(">> ");
    String input = input.nextLine();
    inputColorsStrong.close();

(back to top)

Compiling

To compile & run your java files using the jColors Library manually from the cmd use the next command.

   javac -classpath "jcolors/library/location;jna/library/location/jna/platform/library/location" Class.java
   java -classpath "project/location;jcolors/location;jna/location/jna/platform/location" package.Class

(back to top)

Roadmap

See the open issues for a list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU General Public License. See LICENSE for more information.

Contact

Jihed Kdiss - @jiokdiss - jihedkdiss@outlook.com

Project Link: https://github.com/jihedkdiss/jColors

(back to top)