Colorblind Palettes

Back

How it Works

Colorblind palette color replacements in text boxes are now in beta, as of version 1.01.26.

You specify a palette of (say 10) colors. These are colors which you can differentiate. Then when a text box attempts to use a color to draw text, it will replace the color with the "closest" one in your palette.

How to set it up

First, go to the file Input/Scripts/program_startup.txt and add the following line:
set menu.colorblind.enable true
If that file does not already exist, copy the file Input/Scripts/program_startup_backup.txt and rename the copy "program_startup.txt". That file is run when the program starts up. The language is the program's internal (Lisp style) command language.

Next, open the file "Input/Scripts/game_startup.lua" (if that file does not already exist, copy the file Input/Scripts/game_startup_backup.lua and rename the copy "game_startup.lua"). Open the file. It should look something like this:
function p.__main()
    --Printing to stdout.txt
    ga_print("Here in game_startup.lua")

    --Printing to the console window.
    ga_console_print("^xff00ffHello world from ../../Input/Scripts/game_startup.lua")

    --Initialization for all packages.
    p.package_all()

    ...
end

function p.package_all()
    p.color_blind_init()
    ...
end
The main function is called when you load a game. This will call the function "p.package_all". That function will call "p.color_blind_init" (you may have to uncomment a line for that to happen). The p.color_blind_init function is defined later in the package:
function p.color_blind_init()
    p.color_blind_init_helper(1, "^xcddde3")
    p.color_blind_init_helper(2, "^xf7ee00")
    p.color_blind_init_helper(3, "^x0021e1")
    p.color_blind_init_helper(4, "^x36db00")
    p.color_blind_init_helper(5, "^xed00ff")
    p.color_blind_init_helper(6, "^x0080ff")
    p.color_blind_init_helper(7, "^xff4242")
    p.color_blind_init_helper(8, "^x00c2ff")
    p.color_blind_init_helper(9, "^x7b0470")
    p.color_blind_init_helper(10, "^xff4692")
    p.color_blind_init_helper(11, "INVALID")
end

function p.color_blind_init_helper(i, code)
    if( code == "INVALID" ) then
        local invalid_color = std.vec(-1.0, -1.0, -1.0)
        ga_set_colorblind_bynum(i, invalid_color)
        return
    end
    local color = ga_color_code_to_vec(code)
    ga_set_colorblind_bynum(i, color)
end
Here we see that the function p.color_blind_init sets the color palette to have 10 colors. We must end it with a color called INVALID (otherwise the system will get confused about how many colors there are).

What I Need

For people with color blindness, I would like a palette of 10 or so colors that you can differentiate. You can send this to me on the Discord server. Here is an example of such a palette:

I also need to know what kind of color blindness you have.

Once I have enough of these palettes, we can think of a better way for the user to choose one of these preexisting palettes.

Other Places to Set Text Color

Remember that you can change the default text color of the game by going into the file Input/Scripts/program_startup.txt and adding the following line:
set menu.text_color (vec 1.0 1.0 1.0)
That would set the text color to white. You can also change the default background color by adding the following line:
set menu.back_color (vec 1.0 0.0 0.0)
That would set the default background color to red.