I know that for printing a colored text using echo, for example red color, the code is: echo -e "\e[1;31m This is red text \e[0m"
and I know that in this example, 31 is code of red color and the number of other colors is:

In general, you escape characters that have special meanings in the current technical context. For example, strings are often written within quotes, "like this". But if you want quotation marks within a string, you must escape those chars so they will be interpreted literally and not as delimiters. For example, echo "She said \"Hi\"" As for this case (your question), you'll have to wait for a better answer.
–
Emanuel BergJul 18 '12 at 19:54

I found a nice explanation here (at least, nice for me :-) ). I'm not sure if it'll be useful for you.

To start, type this on your console:

echo "^[[0;31;40mIn Color"

The first character is an escape character, which looks like two characters, ^ and [. To be able to print this, you have to press CTRL+V and then the ESC key. All the other characters are normal printable characters, so you see the string In Color in red. The type stays that color until you revery back by typing this:

They are escape codes to set the color modes in the terminal. Is just that when printed with regular characters, they look like that.

\e is shorthand for the Escape character. the <ESC>[ and the m are the markers for the beginning and end of ANSI color control sequences, which are a subset of ANSI terminal control sequenced. Most of them start with <ESC>[, followed by a number, followed by a letter indicating which function is being implemented (e. g. move cursor to line; clear to end of line, return cursor to saved location, et cetera).

So basically its just the way different terminal interpret color codes and you caption your text within these elements. Its an odd way to make the terminal understand what you mean (like HexCodes or Binary..)