Index: code/freespace2/freespace.cpp
===================================================================
--- code/freespace2/freespace.cpp	(revision 7808)
+++ code/freespace2/freespace.cpp	(working copy)
@@ -2024,7 +2024,9 @@
 	load_animating_pointer(NOX("cursor"), 0, 0);	
 
 	// initialize alpha colors
-	alpha_colors_init();	
+	//CommanderDJ: try with colors.tbl first, then use the old way if that doesn't work
+	if(!new_alpha_colors_init())
+		old_alpha_colors_init();
 
 	if (Cmdline_env) {
 		ENVMAP = Default_env_map = bm_load("cubemap");
Index: code/globalincs/alphacolors.cpp
===================================================================
--- code/globalincs/alphacolors.cpp	(revision 7808)
+++ code/globalincs/alphacolors.cpp	(working copy)
@@ -8,10 +8,10 @@
 */ 
 
 #include "graphics/2d.h"
+#include "parse/parselo.h"
+#include "globalincs/def_files.h"
 #include "globalincs/alphacolors.h"
 
-
-
 // -----------------------------------------------------------------------------------
 // ALPHA DEFINES/VARS
 //
@@ -24,7 +24,7 @@
 color Color_ui_light_pink, Color_ui_pink;
 
 // netplayer colors
-color *Color_netplayer[20] = {
+color *Color_netplayer[NETPLAYER_COLORS] = {
 
 	&Color_blue,
 	&Color_bright_blue,
@@ -53,8 +53,144 @@
 // ALPHA FUNCTIONS
 //
 
+//CommanderDJ: initialise alpha colors based on tbl
+//returns 1 if successful
+//0 if not
+int new_alpha_colors_init()
+{
+	int err_code;
+	if((err_code = setjmp(parse_abort)) != 0) 
+	{
+		mprintf(("Unable to parse 'colors.tbl'!  Error code = %d.\n", err_code));
+		return 0;
+	}
+
+	if(cf_exists_full("colors.tbl", CF_TYPE_TABLES))
+	{
+		read_file_text("colors.tbl", CF_TYPE_TABLES);
+		mprintf(("TABLES => Starting parse of 'colors.tbl'...\n"));
+	}
+	else
+	{
+		//colors.tbl doesn't exist
+		mprintf(("TABLES => Unable to find 'colors.tbl'. Initialising colors with default values.\n"));
+		return 0;
+	}
+
+	reset_parse();
+	
+	//we search for the colors based on their order of definition above
+	//if the color isn't found, we just use default values
+	if(required_string("#Start Colors"))
+	{
+		//vars for holding rgba values
+		int rgba[4] = {0,0,0,0};
+
+		color *colors[TOTAL_COLORS] = {
+			&Color_blue,
+			&Color_bright_blue,
+			&Color_green,
+			&Color_bright_green,
+			&Color_black,
+			&Color_grey,
+			&Color_silver,
+			&Color_white,
+			&Color_bright_white,
+			&Color_violet_gray,
+			&Color_violet,
+			&Color_dim_red,
+			&Color_red,
+			&Color_bright_red,
+			&Color_pink,
+			&Color_light_pink,
+			&Color_yellow,
+			&Color_bright_yellow,
+			&Color_ui_light_green,
+			&Color_ui_green,
+			&Color_ui_light_pink,
+			&Color_ui_pink,
+		};
+
+		char* color_names[TOTAL_COLORS];
+		color_names[0] = "$Blue:";
+		color_names[1] = "$Bright Blue:";
+		color_names[2] = "$Green:";
+		color_names[3] = "$Bright Green:";
+		color_names[4] = "$Black:";
+		color_names[5] = "$Grey:";
+		color_names[6] = "$Silver:";
+		color_names[7] = "$White:";
+		color_names[8] = "$Bright White:";
+		color_names[9] = "$Violet Gray:";
+		color_names[10] = "$Violet:";
+		color_names[11] = "$Dim Red:";
+		color_names[12] = "$Red:";
+		color_names[13] = "$Bright Red:";
+		color_names[14] = "$Pink:";
+		color_names[15] = "$Light Pink:";
+		color_names[16] = "$Yellow:";
+		color_names[17] = "$Bright Yellow:";
+		color_names[18] = "$UI Light Green:";
+		color_names[19] = "$UI Green:";
+		color_names[20] = "$UI Light Pink:";
+		color_names[21] = "$UI Pink:";
+		
+		int rgba_defaults[TOTAL_COLORS][4] = {
+			93, 93, 128, 255,
+			185, 185, 255, 255,
+			0, 120, 0, 255,
+			50, 190, 50, 255,
+			0, 0, 0, 255,
+			65, 65, 65, 255,
+			160, 160, 160, 255,
+			105, 105, 105, 255,
+			255, 255, 255 ,255,
+			160, 144, 160, 255,
+			192, 104, 192, 255,
+			80, 6, 6, 255,
+			126, 6, 6, 255,
+			200, 0, 0, 255,
+			185, 150, 150, 255,
+			230, 190, 190, 255,
+			255, 255, 122, 255,
+			255, 255, 0, 255,
+			161, 184, 161, 255,
+			190, 228, 190, 255,
+			184, 161, 161, 255,
+			228, 190, 190, 255
+		};
+
+		//now for each color, check if it's corresponding string is there
+		for(int i=0; i<TOTAL_COLORS; i++)
+		{
+			if(optional_string(color_names[i]))
+			{
+				//if so, get its rgba values and initialise it using them
+				mprintf(("'%s' has been redefined.\n", color_names[i]));
+				stuff_int_list(rgba, 4, RAW_INTEGER_TYPE);
+				for(int j=0; j<4; j++)
+				{
+					if(rgba[j] < 0)
+					rgba[j] = 0;
+					if(rgba[j] > 255)
+					rgba[j] = 255;
+				}
+				gr_init_alphacolor(colors[i], rgba[0], rgba[1], rgba[2], rgba[3]);
+			}
+			//otherwise use its defaults
+			else
+				gr_init_alphacolor(colors[i], rgba_defaults[i][0], rgba_defaults[i][1], rgba_defaults[i][2], rgba_defaults[i][3]);
+		}
+		required_string("#End");
+
+		return 1;
+	}
+	//if we get here, then something's wrong with the table
+	return 0;
+}
+
 // initialize all alpha colors (call at startup)
-void alpha_colors_init()
+void old_alpha_colors_init()
 {
 	// See the variable declarations above for color usage
 	gr_init_alphacolor( &Color_blue, 93, 93, 128, 255 );
Index: code/globalincs/alphacolors.h
===================================================================
--- code/globalincs/alphacolors.h	(revision 7808)
+++ code/globalincs/alphacolors.h	(working copy)
@@ -11,6 +11,8 @@
 #define _GLOBAL_ALPHACOLORS_HEADER_FILE
 
 #include "graphics/2d.h"
+#include "parse/parselo.h"
+#include "globalincs/def_files.h"
 
 // -----------------------------------------------------------------------------------
 // ALPHA DEFINES/VARS
@@ -39,6 +41,7 @@
 
 #define Color_bright Color_bright_blue
 #define Color_normal Color_white
+#define TOTAL_COLORS 22
 extern color Color_blue, Color_bright_blue, Color_green, Color_bright_green;
 extern color Color_black, Color_grey, Color_silver, Color_white, Color_bright_white;
 extern color Color_violet_gray, Color_violet, Color_pink, Color_light_pink;
@@ -48,14 +51,19 @@
 extern color Color_ui_light_pink, Color_ui_pink;
 
 // netplayer colors
-extern color *Color_netplayer[20];
+#define NETPLAYER_COLORS 20
+extern color *Color_netplayer[NETPLAYER_COLORS];
 
 // -----------------------------------------------------------------------------------
 // ALPHA FUNCTIONS
 //
 
-// initialize all alpha colors (call at startup)
-void alpha_colors_init();
+//initialize alpha colors based on colors.tbl
+int new_alpha_colors_init();
 
+//initialize alpha colors based on hardcoded values
+void old_alpha_colors_init();
 
+
+
 #endif
