JAVA - GauravWalia19/RAINBOW GitHub Wiki

:cloud: USAGE IN JAVA (:octocat: LINUX / MAC :octocat:)

DEVELOPER USE

1. Download the ZIP or clone the repository using

 git clone https://github.com/GauravWalia19/RAINBOW.git

2. Navigate to the download or cloning place folder(Open terminal and follow commands)

cd ~
cd Downloads
cd RAINBOW-master || cd RAINBOW
cd src/JAVA
bash java.sh

3. If U want to use in your code than create a file with extension of java (hello.java) in JAVA folder. Write the code given below:

Terminal

touch hello.java

Open file hello.java in Text Editor and write code given below:

public class hello
{
    public static void main(String[] args)
    {
        rain obj = new rain();
        System.out.println(obj.BRED + "Hello World" + obj.RESET);

        rainbow ob = new rainbow();
        System.out.println(ob.getBRED("Hello World"));
    }
}

4. Compile and Run using commands:

javac hello.java
java hello

OTHERS

You can simply used JAVA PACKAGE to do use it.Follow the steps below:

1. Download the ZIP or clone the repository using

 git clone https://github.com/GauravWalia19/RAINBOW.git

2. Extract and open the files of the repository and open src folder.

cd ~
cd Downloads
cd RAINBOW-master || cd RAINBOW
cd src

3. Now you have package name RAINBOW. Use in your code by importing.

  • Create a sample file of java to run it
touch trial.java
  • Enter the following code in that file
import RAINBOW.*;
public class trial
{
    public static void main(String[] args)
    {
        Rainbow r = new Rainbow();
        System.out.println(r.getBBGDGREEN("HELLO WORLD")+r.getRESET());

        Rain R = new Rain();
        System.out.println(R.BRED+"hello world"+R.RESET);
    }
}
  • Compile and run using commands
javac trial.java
java trial