Results 1 to 2 of 2
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    United Kingdom
    Rep Power

    Default Adding Colors to System.out.println() in console


    Firstly I'm going to mention that I have read many forums and other areas of discussion and help, all the replies lead to saying that to find out how, you need to go to the wikipedia page regarding ANSI escape sequences. However, I am very confused with those, I don't understand, people say I have to use something like /u001 or something but the wiki says something like /x001A[32m or something, can't remember just to give an idea of the format. If I have Red, Blue and Green values of a color, how do I use these to calculate and get an ANSI escape sequence that I can use in System.out.println() to color the text? Not necesserily in code, just simply the steps to making the color code, I'm going to implement this into code anyway, so telling me how I can do it with code is fine. Sort of like String getColor(int red, int green, int blue); this function returning the ANSI escape sequence I can use in System.out.println to color the output console text! Thanks a lot!


  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Adding Colors to System.out.println() in console

    ANSI escape sequences don't work in the console on most modern computers.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 8
    Last Post: 06-21-2011, 02:21 PM
  2. Println VS system.out.println
    By ccie007 in forum New To Java
    Replies: 2
    Last Post: 05-20-2010, 08:52 AM
  3. difference between system.out.println() & out.println()
    By wickedrahul9 in forum Advanced Java
    Replies: 5
    Last Post: 10-18-2008, 11:06 PM
  4. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 01:30 AM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts