Swap a 'max' for a 'min', fixing an out-of-range colour component
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 8 Apr 2012 13:06:46 +0000 (13:06 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 8 Apr 2012 13:06:46 +0000 (13:06 +0000)
being passed to the front end.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9451 cda61777-01e9-0310-a592-d414129be87e

galaxies.c

index d8906b6..b9eb603 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;