Ren'Py Need help changing text colors.

Hornyviking

Newbie
Aug 13, 2017
15
5
Hi all!

I happen to be colorblind. That makes some of the games hard for me to see the text. Or sometimes when I have a cheat installed I still don't see what chois it is. I would be really happie if someone cold help me make like a universal script for me to put in the game folder if its possible.
 
  • Like
Reactions: osanaiko

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,172
I happen to be colorblind. That makes some of the games hard for me to see the text. Or sometimes when I have a cheat installed I still don't see what chois it is. I would be really happie if someone cold help me make like a universal script for me to put in the game folder if its possible.
An universal script, hmm... There's three problems for this.
Firstly the fact that there's many different ways to deal with the colors. Secondly the fact that "colorblind" is a generic word, behind there's seven (from memory) different troubles. Thirdly, the problem don't limits to the text color. The alternate color could perfectly still be difficultly visible, depending of the background on top of which it's displayed.

The first problem can perhaps be overcome, but the second one would need a more complex algorithm and a replacement map by trouble. As for the third one, there's not much that can be done ; it would be time consuming to scan each image to find its dominant color, even when limiting it to the say dialog box.
 

Hornyviking

Newbie
Aug 13, 2017
15
5
An universal script, hmm... There's three problems for this.
Firstly the fact that there's many different ways to deal with the colors. Secondly the fact that "colorblind" is a generic word, behind there's seven (from memory) different troubles. Thirdly, the problem don't limits to the text color. The alternate color could perfectly still be difficultly visible, depending of the background on top of which it's displayed.

The first problem can perhaps be overcome, but the second one would need a more complex algorithm and a replacement map by trouble. As for the third one, there's not much that can be done ; it would be time consuming to scan each image to find its dominant color, even when limiting it to the say dialog box.
The second problems is not so hard. As long as I can edit the script and change the colors by my self :) for exempel putting 0000ffff for blue or typing blue inside the script. But I can se that it can be a a problem with the first part.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,576
2,204
Okay.
If you're happy enough to edit code, you should be okay.


Getting access to the source code:

Firstly, you'll need to be able to get to the RenPy script (the .rpy files).
Some games will include them already... In which case... great.

But some games will "compress" the game within .rpa archives). This is probably the most common configuration.
You'll need a tool like UnRen, to unpack the game from the .rpa file(s). This will get you the .rpyc files and usually the .rpy files too.

RenPy games don't actually need the .rpy files to run. They only need the .rpyc (compiled) versions of the script file. Some developers MAY choose not to include them within the archives. But that's okay, because UnRen also has an option to recreate the .rpy scripts based on the .rpyc files. (it's option "2" from the menu).

You should now have access to the source code to edit however you like.


The default font color:

Unless told otherwise, RenPy will use only a small number of default colors. All stored in the gui.rpy file.

The first two you probably want to worry about are:
  • gui.text_color
  • gui.interface_text_color
Then maybe:
  • gui.choice_button_text_idle_color
  • gui.choice_button_text_hover_color
That'll cover the majority of "normal" text shown by the game, including choices made by the player.

After those, you might want to take a look at:
  • gui.button_text_idle_color
  • gui.button_text_hover_color
  • gui.button_text_selected_color
  • gui.button_text_insensitive_color
Though these are used and reused in other less obvious areas of the game.

With any of these color changes, I would suggest initially changing them to a VERY high contrast color you can see clearly (GREEN / YELLOW / PINK / PURPLE / RED). Something not actively used by the game which will make any change you make stand out like a sore thumb. Only when you are sure you know what areas of the game your change affects - change it to another color that works for you (even if it's only BLACK / WHITE).


One Ring To Rule Them All:

Okay. Maybe not a ring.
But RenPy picks up some functionality from python which can be applied to these define gui.... type lines.

If you created a separate file called zzz_my_inits.rpy and code:

Python:
init 997:
    define gui.text_color = '#FF0000'
    define gui.interface_text_color = '#FF0000'
Those two lines would override the values stored in gui.rpy (in this case, to use RED instead).

Normally (unless specified otherwise), RenPy initialization is done at initialization priority 0 (init 0). RenPy runs all the level 0 code, then any level 1 code that may exists, then 2, etc. The documentation recommends numbers between -999 and 999.

As you figure out which gui parameters tend to need overriding most of the time and what you want those colors to be... just add more lines to your zzz_my_inits.rpy file (or whatever you choose to call it).

Having a small .rpy file which includes all your default overrides running at init 997: won't solve all your problems - but it's an option for a good start. Just copy your override file into the game's /game/ folder before running the game.


Character colors:

Some developers often override the default colors used by RenPy and specify their own. This is usually only the text used to display the name of the character, but some developers will change the color of that character's dialogue too.

Look for code like:

Python:
define mc = Character("[mc_name]", color="#4169E1", who_outlines=[ (2, "#000000")])
define vic = Character("Victoria", color="#FF1493", who_outlines=[ (2, "#000000")], what_color="#FFFF99")

If you're comfortable changing one color code for another... do that.
Alternatively, just remove the color overrides completely and use the RenPy defaults (that you overrode yourself, earlier).


There IS more:

Changing the code using the bits of information above will get the majority of things under control. But there will be more. Especially for games either written by very inexperienced RenPy developers or by very experienced ones.

The worst case scenario I can think of for you is text which is actually an image.

This will probably get you 80% there. But it's going to be increasing difficult to enable "color blind mode" within games what weren't initially planning to support that sort of UI design.

Good luck.
 

Hornyviking

Newbie
Aug 13, 2017
15
5
Okay.
If you're happy enough to edit code, you should be okay.


Getting access to the source code:

Firstly, you'll need to be able to get to the RenPy script (the .rpy files).
Some games will include them already... In which case... great.

But some games will "compress" the game within .rpa archives). This is probably the most common configuration.
You'll need a tool like UnRen, to unpack the game from the .rpa file(s). This will get you the .rpyc files and usually the .rpy files too.

RenPy games don't actually need the .rpy files to run. They only need the .rpyc (compiled) versions of the script file. Some developers MAY choose not to include them within the archives. But that's okay, because UnRen also has an option to recreate the .rpy scripts based on the .rpyc files. (it's option "2" from the menu).

You should now have access to the source code to edit however you like.


The default font color:

Unless told otherwise, RenPy will use only a small number of default colors. All stored in the gui.rpy file.

The first two you probably want to worry about are:
  • gui.text_color
  • gui.interface_text_color
Then maybe:
  • gui.choice_button_text_idle_color
  • gui.choice_button_text_hover_color
That'll cover the majority of "normal" text shown by the game, including choices made by the player.

After those, you might want to take a look at:
  • gui.button_text_idle_color
  • gui.button_text_hover_color
  • gui.button_text_selected_color
  • gui.button_text_insensitive_color
Though these are used and reused in other less obvious areas of the game.

With any of these color changes, I would suggest initially changing them to a VERY high contrast color you can see clearly (GREEN / YELLOW / PINK / PURPLE / RED). Something not actively used by the game which will make any change you make stand out like a sore thumb. Only when you are sure you know what areas of the game your change affects - change it to another color that works for you (even if it's only BLACK / WHITE).


One Ring To Rule Them All:

Okay. Maybe not a ring.
But RenPy picks up some functionality from python which can be applied to these define gui.... type lines.

If you created a separate file called zzz_my_inits.rpy and code:

Python:
init 997:
    define gui.text_color = '#FF0000'
    define gui.interface_text_color = '#FF0000'
Those two lines would override the values stored in gui.rpy (in this case, to use RED instead).

Normally (unless specified otherwise), RenPy initialization is done at initialization priority 0 (init 0). RenPy runs all the level 0 code, then any level 1 code that may exists, then 2, etc. The documentation recommends numbers between -999 and 999.

As you figure out which gui parameters tend to need overriding most of the time and what you want those colors to be... just add more lines to your zzz_my_inits.rpy file (or whatever you choose to call it).

Having a small .rpy file which includes all your default overrides running at init 997: won't solve all your problems - but it's an option for a good start. Just copy your override file into the game's /game/ folder before running the game.


Character colors:

Some developers often override the default colors used by RenPy and specify their own. This is usually only the text used to display the name of the character, but some developers will change the color of that character's dialogue too.

Look for code like:

Python:
define mc = Character("[mc_name]", color="#4169E1", who_outlines=[ (2, "#000000")])
define vic = Character("Victoria", color="#FF1493", who_outlines=[ (2, "#000000")], what_color="#FFFF99")

If you're comfortable changing one color code for another... do that.
Alternatively, just remove the color overrides completely and use the RenPy defaults (that you overrode yourself, earlier).


There IS more:

Changing the code using the bits of information above will get the majority of things under control. But there will be more. Especially for games either written by very inexperienced RenPy developers or by very experienced ones.

The worst case scenario I can think of for you is text which is actually an image.

This will probably get you 80% there. But it's going to be increasing difficult to enable "color blind mode" within games what weren't initially planning to support that sort of UI design.

Good luck.
Thanks you where mutch :D I will try and see if I can get it done. For exemple its the game FamilyLife Renpy version. And its mainly the GUI there. I cant see the diffrens almost att the Yellow and Green. So I will try to do it for that game :)
 
  • Like
Reactions: 79flavors