# How to change Font Color?

**URL:** <https://forum.choiceofgames.com/t/how-to-change-font-color/1465>\
**Category:** ChoiceScript Help\
**Created:** [June 21, 2013, 5:16am UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465 "2013-06-21T05:16:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueOwl358](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/blueowl358/32/1169_2.png) [@BlueOwl358](https://forum.choiceofgames.com/u/BlueOwl358)\
**Post date:** [June 21, 2013, 5:16am UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/1 "2013-06-21T05:16:44Z")

</div>

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:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [June 21, 2013, 5:31am UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/2 "2013-06-21T05:31:07Z")

</div>

style.css -\>

body {  
color: #somecolourcode  
}

---

<div class="post-metadata">

**Author:** ![BlueOwl358](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/blueowl358/32/1169_2.png) [@BlueOwl358](https://forum.choiceofgames.com/u/BlueOwl358)\
**Post date:** [June 21, 2013, 5:35am UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/3 "2013-06-21T05:35:45Z")

</div>

Thanks, It worked.

---

<div class="post-metadata">

**Author:** ![nine](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@nine](https://forum.choiceofgames.com/u/nine)\
**Post date:** [August 8, 2013, 10:55am UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/4 "2013-08-08T10:55:00Z")

</div>

@CJW (and @anyoneelsewhoknowstheforce)

Little post bump BUT… I was wondering if there is a way of having variable font colours for a CS game. I understand the above stylesheet hack changes ALL the font in a game but I don’t want to change all the font colour all the time, just some of the colour some of the time.

Is there a way of doing it like **you would bold something** and then _you would italic something_ and then you would [blue] write in blue text for a time [/blue] before going back to normal? If not - would it be simple enough to add to the codestuff that makes all this CS madness possible?

I’m hoping yes but then I’m just a protocol droid and not very knowledgeable about such things! :-??

Much love  
D

(edit - the blue text above may not be visible on everyone’s browser!)

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [August 8, 2013, 1:36pm UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/5 "2013-08-08T13:36:50Z")

</div>

@nine

Only by changing the cs interpreter code.  
Look in the ui.js file and at the top there is a function called printx  
within it there is a series of .replace lines, like:

`.replace(/\\[i\\]/g, '<i>') .replace(/\\[\\/i\\]/g, '</i>')`

You want to add two more, similar to this:

`.replace(/\\[blue\\]/g, '<span style="color:blue;">') .replace(/\\[\\/blue\\]/g, '</span>');`

Note that the semicolon is only necessary on your last line.  
Whether or not this sort of modification will work with published titles, I cannot say.

---

<div class="post-metadata">

**Author:** ![nine](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@nine](https://forum.choiceofgames.com/u/nine)\
**Post date:** [August 8, 2013, 2:29pm UTC](https://forum.choiceofgames.com/t/how-to-change-font-color/1465/6 "2013-08-08T14:29:42Z")

</div>

@CJW thank you very much! Genius!
