[How-to] Add more Colors to the chat (more than the default 9)

I did this post, because i didn’t find any other post in the forum or the web about how to do the following

Is well know that you can type in color in the chat if you use ^[0-9] before the text you want to colorize, being 0 to 9 the color codes availables, see this post:

So, what if i want to have more colors availables?, like a pink a orange or any color that is not in the default colors.

Well, follow my steps

First Step

-> Go to your resources folder and find this file

===> resources/[system]/chat/html/index.css

Second Step
-> In index.css go to line 10 and add this below the other colors

.color-10{color: #ff8000;}

this color (orange) is just an examble, can be any color in hex

you can add up to .color-99 if you want

Now, maybe you are wondering, all this post for just that?

Well no.

Third Step

-> If you are still in the /html folder, open this file.
===> Message.js

Fourth Step

-> In Message.js go to line 37 and change this

let s = "<span>" + (str.replace(/\^([0-9])/g, (str, color) => )) + "</span>";

to this:

let s = "<span>" + (str.replace(/\^([0-9][0-9]?)/g, (str, color) => )) + "</span>";

Now save all the changes and test your new colors!!

I Hope this was useful

I was to lazy to add screenshots, but i hope someone share their results in the comments

Editing of default resources is highly discouraged and not permitted on the forum. As such, edit the tutorial such that it uses a chat-theme instead. See https://github.com/citizenfx/cfx-server-data/tree/master/resources/[gameplay]/chat-theme-gtao for an example