jquery-terminal

Add color to JQuery Terminal


I am trying to add color the the jquery terminal like a bash terminal in linux.

I have tried the same arrangement of color codes

\033]01;31\] # pink
\033]00m\]   # white
\033]01;36\] # bold green
\033]02;36\] # green
\033]01;34\] # blue
\033]01;33\] # bold yellow

and there is no color options.


Solution

  • A function I use is like so for javascript

    function teal(message) {
        return "[[gb;teal;black]" + message + "]";
    }
    

    Just wrap the string like the above.

    The first colour is the text color and the second color is the background.

    The gb at the start are for string formatting;

    g = glow & b = bold

    You can also under line and make them italic aswell

    i = italic & u = underline

    In the string, make sure not to have any [ or ] as this will affect the formatting. Use the escape character \[ or \] and it should work.

    It will also work in C# as I have done this myself and should see no reason it wouldn't work with the likes of Java strings either.