chiark / gitweb /
Swap a 'max' for a 'min', fixing an out-of-range colour component
authorSimon Tatham <anakin@pobox.com>
Sun, 8 Apr 2012 13:06:46 +0000 (13:06 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 8 Apr 2012 13:06:46 +0000 (13:06 +0000)
being passed to the front end.

[originally from svn r9451]

galaxies.c

index d8906b6841bba5abf7ff83d4e9c9f74b8662aba4..b9eb603a29b9e91862b0c137bf8ea1976d08c8ec 100644 (file)
@@ -2977,10 +2977,10 @@ static float *game_colours(frontend *fe, int *ncolours)
     /* tinge the edit background to bluey */
     ret[COL_BACKGROUND * 3 + 0] = ret[COL_BACKGROUND * 3 + 0] * 0.8F;
     ret[COL_BACKGROUND * 3 + 1] = ret[COL_BACKGROUND * 3 + 0] * 0.8F;
-    ret[COL_BACKGROUND * 3 + 2] = max(ret[COL_BACKGROUND * 3 + 0] * 1.4F, 1.0F);
+    ret[COL_BACKGROUND * 3 + 2] = min(ret[COL_BACKGROUND * 3 + 0] * 1.4F, 1.0F);
 #endif
 
-    ret[COL_CURSOR * 3 + 0] = max(ret[COL_BACKGROUND * 3 + 0] * 1.4F, 1.0F);
+    ret[COL_CURSOR * 3 + 0] = min(ret[COL_BACKGROUND * 3 + 0] * 1.4F, 1.0F);
     ret[COL_CURSOR * 3 + 1] = ret[COL_BACKGROUND * 3 + 0] * 0.8F;
     ret[COL_CURSOR * 3 + 2] = ret[COL_BACKGROUND * 3 + 0] * 0.8F;