# Changing text colours

**URL:** <https://forum.choiceofgames.com/t/changing-text-colours/23553>\
**Category:** ChoiceScript Help\
**Created:** [January 25, 2017, 11:18pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553 "2017-01-25T23:18:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avery\_Moore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/avery_moore/32/57275_2.png) [@Avery\_Moore](https://forum.choiceofgames.com/u/Avery_Moore)\
**Post date:** [January 25, 2017, 11:18pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/1 "2017-01-25T23:18:09Z")

</div>

Is there any coding that can be used to change the colour of text in choicescript? Not for the entire game, that would just be an eyesore, but for certain parts of the game it would come in really useful. 😊

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 25, 2017, 11:32pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/2 "2017-01-25T23:32:29Z")

</div>

`ui.js` under the `printx()` function there’s a handful of `.replaces`, which is the easiest way to insert html. Just create your own. Noteworthy that anything outside standard ChoiceScript can pose a problem to publishing.

---

<div class="post-metadata">

**Author:** ![Avery\_Moore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/avery_moore/32/57275_2.png) [@Avery\_Moore](https://forum.choiceofgames.com/u/Avery_Moore)\
**Post date:** [January 26, 2017, 12:04pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/3 "2017-01-26T12:04:03Z")

</div>

… Yeah, I’m going to be honest, I didn’t understand a word of that. Something to do with Javascript? 😕

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [January 26, 2017, 12:26pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/4 "2017-01-26T12:26:28Z")

</div>

As another someone who also didn’t understand but a 'lil bit about that, I think I can explain it to you as this:

To change text colours, you have to modify one (or maybe more) of javascript file(s) which is basically another coding-work.

The problem is, you’ll have to learn javascript coding-technique to not make any mistake while editing the file(s), and doing that means you can’t publish your WIP under Hosted Games nor CoG banner.

---

<div class="post-metadata">

**Author:** ![Silhuetta](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/silhuetta/32/24847_2.png) [@Silhuetta](https://forum.choiceofgames.com/u/Silhuetta)\
**Post date:** [January 26, 2017, 12:28pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/5 "2017-01-26T12:28:58Z")

</div>

Yeah, coding in font color is too difficult for me. It’s already excruciating enough to struggle through CS code. Anyways, here’s a post that might help you:

> [@How to change Font Color?](https://forum.choiceofgames.com/t/how-to-change-font-color/1465):
>
> Hello Choice of Games. This is a very simple question and I know it has a simple answer. But I have looked everywhere but I can’t seem to figure out how to change the Font Color. My game has a Dark Blue Background and I would like to have the text be of White Color. I know it will be a very easy thing but I am very stuck. Please Help.

---

<div class="post-metadata">

**Author:** ![Avery\_Moore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/avery_moore/32/57275_2.png) [@Avery\_Moore](https://forum.choiceofgames.com/u/Avery_Moore)\
**Post date:** [January 26, 2017, 1:44pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/6 "2017-01-26T13:44:57Z")

</div>

Wow! I did not think that changing text colour would be so complicated. Maybe I’ll just keep it all the same. 😋

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 26, 2017, 4:04pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/7 "2017-01-26T16:04:31Z")

</div>

Yea, basically we don’t support it yet, so if you want it, you have to hack it in.

(Looking back, yea, I kinda assumed a knowledge of the basic JavaScript architecture. Bad form on my part.)

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [January 27, 2017, 2:02am UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/8 "2017-01-27T02:02:17Z")

</div>

> [@RETowers](#):
>
> we don’t support it yet

I guess I can assume that it will be supported sooner or later? 😏

P.S.: Ah, off-topic. NVM me :v

---

<div class="post-metadata">

**Author:** ![Avery\_Moore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/avery_moore/32/57275_2.png) [@Avery\_Moore](https://forum.choiceofgames.com/u/Avery_Moore)\
**Post date:** [January 27, 2017, 2:41pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/9 "2017-01-27T14:41:35Z")

</div>

> [@RETowers](#):
>
> (Looking back, yea, I kinda assumed a knowledge of the basic JavaScript architecture. Bad form on my part.)

Lol. I guess most people who use Choicescript have a basic knowledge of Javascript too. Honestly, I’m just kind of figuring everything out as I go along. 😋

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 27, 2017, 3:09pm UTC](https://forum.choiceofgames.com/t/changing-text-colours/23553/10 "2017-01-27T15:09:46Z")

</div>

Actually most don’t. Since I already started answering, let me see if I can expand.

In the `web` folder, there is a file called `ui.js` or (Although it may just say `ui` with a `JS File` as it’s “type”). That’s one of the JavaScript files CS uses to run. In it, the very first function is called `function printx`. Indented in that function is a number of lines that say `.replace(foo, bar)` where `foo` is something like `/</g` and `bar` is something like `'&lt;'` Well that replaces the less than sigh `<` with the HTML entity `&lt;`. It’s possible to mess with these (adding or removing some) to start writing HTML into a page.

The side effect is this gets _very_ breakable, _very_ fast.
