patches/xscreensaver-15-OpenSolaris-colors.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 18124 ac2b6be91df8
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.

/*
 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

Use OpenSolaris branding colors in various hacks to better match color schemes
of the rest of the desktop.

Colors from OpenSolaris "bubbles" logo:
	#76A141 / rgb(118, 161,  65) /* green */
	#6CAEDF / rgb(108, 174, 223) /* blue */
	#005695 / rgb(  0,  86, 149) /* dark blue */
	#808084 / rgb(128, 128, 132) /* grey */
	#251A06 / rgb( 37,  26,   6) /* very dark grey */

diff --git xscreensaver-5.11/driver/XScreenSaver.ad.in xscreensaver-5.11/driver/XScreenSaver.ad.in
--- xscreensaver-5.11/driver/XScreenSaver.ad.in
+++ xscreensaver-5.11/driver/XScreenSaver.ad.in
@@ -317,7 +317,7 @@ GetViewPortIsFullOfLies: False
 				anemotaxis -root			    \n\
 - GL: 				antinspect -root			    \n\
 				fireworkx -root				    \n\
-				fuzzyflakes -root			    \n\
+				fuzzyflakes -root -color 6CAEDF		    \n\
 				interaggregate -root			    \n\
 				intermomentary -root			    \n\
 				memscroller -root			    \n\
diff --git xscreensaver-5.11/hacks/glx/antinspect.c xscreensaver-5.11/hacks/glx/antinspect.c
--- xscreensaver-5.11/hacks/glx/antinspect.c
+++ xscreensaver-5.11/hacks/glx/antinspect.c
@@ -94,13 +94,13 @@ static const float position1[] = {-1.0, -3.0, 1.0, 0.0};
 static const float lmodel_ambient[] = {0.5, 0.5, 0.5, 1.0};
 static const float lmodel_twoside[] = {GL_TRUE};
 
-static const float MaterialRed[] =     {0.6, 0.0, 0.0, 1.0};
-static const float MaterialOrange[] =  {1.0, 0.69, 0.00, 1.0};
-static const float MaterialGray[] =    {0.2, 0.2, 0.2, 1.0};
-static const float MaterialBlack[] =   {0.1, 0.1, 0.1, 0.4};
+static const float MaterialRed[] =     {0.4219, 0.68, 0.87, 1.0}; /* blue */
+static const float MaterialOrange[] =  {0.4609, 0.63, 0.254, 1.0}; /* green */
+static const float MaterialGray[] =    {0.2, 0.2, 0.20625, 1.0}; 
+static const float MaterialBlack[] =   {0.1445, 0.1016, 0.02344, 0.4};
 static const float MaterialShadow[] =   {0.3, 0.3, 0.3, 0.3};
-static const float MaterialGray5[] =   {0.5, 0.5, 0.5, 0.3};
-static const float MaterialGray6[] =   {0.6, 0.6, 0.6, 1.0};
+static const float MaterialGray5[] =   {0.5, 0.5, 0.515625, 0.3};
+static const float MaterialGray6[] =   {0.6, 0.6, 0.61875, 1.0};
 
 static antinspectstruct *antinspect = (antinspectstruct *) NULL;
 
diff --git xscreensaver-5.11/hacks/glx/antmaze.c xscreensaver-5.11/hacks/glx/antmaze.c
--- xscreensaver-5.11/hacks/glx/antmaze.c
+++ xscreensaver-5.11/hacks/glx/antmaze.c
@@ -148,13 +148,13 @@ typedef struct {
 static antmazestruct *antmaze = (antmazestruct *) NULL;
 
 
-static const GLfloat MaterialRed[] = {0.6, 0.0, 0.0, 1.0};
+static const GLfloat MaterialRed[] = {0.0, 0.336, 0.582, 1.0}; /* dark blue */
 /*static const GLfloat MaterialMagenta[] = {0.6, 0.2, 0.5, 1.0};*/
-static const GLfloat MaterialGray8[] = {0.8, 0.8, 0.8, 1.0};
-static const GLfloat MaterialGray35[] = {0.30, 0.30, 0.30, 1.0};
-static const GLfloat MaterialGray4[] = {0.40, 0.40, 0.40, 1.0};
-static const GLfloat MaterialOrange[] = {1.0, 0.69, 0.00, 1.0};
-static const GLfloat MaterialGreen[] = {0.1, 0.4, 0.2, 1.0};
+static const GLfloat MaterialGray8[] = {0.8, 0.8, 0.825, 1.0};
+static const GLfloat MaterialGray35[] = {0.30, 0.30, 0.3094, 1.0};
+static const GLfloat MaterialGray4[] = {0.40, 0.40, 0.4125, 1.0};
+static const GLfloat MaterialOrange[] = {0.4219, 0.68, 0.87, 1.0}; /* blue */
+static const GLfloat MaterialGreen[] = {0.4609, 0.63, 0.254, 1.0};
 
 /* lighting variables */
 static const GLfloat front_shininess[] = {60.0};
diff --git xscreensaver-5.11/hacks/glx/flipflop.c xscreensaver-5.11/hacks/glx/flipflop.c
--- xscreensaver-5.11/hacks/glx/flipflop.c
+++ xscreensaver-5.11/hacks/glx/flipflop.c
@@ -602,6 +602,13 @@ randsheet_free( randsheet *rs )
 	free(rs->tex);
 }
 
+
+static const float brand_colors[3][3] = {
+    {0.46093750, .628906250, 0.2539062500},	/* green */
+    {0.00, 0.3359375, 0.58203125},		/* dark blue */
+    {0.4218750, 0.67968750, 0.871093750}	/* light blue */
+};
+
 static void
 randsheet_initialize( randsheet *rs )
 {
@@ -619,9 +626,13 @@ randsheet_initialize( randsheet *rs )
                             rs->xpos[ index ] = i;
                             rs->ypos[ index ] = j;
 							/* have the square colors start out as a pattern */
-							rs->color[ index*3 + 0 ] = ((i+j)%3 == 0)||((i+j+1)%3 == 0);
-							rs->color[ index*3 + 1 ] = ((i+j+1)%3 == 0);
-							rs->color[ index*3 + 2 ] = ((i+j+2)%3 == 0);
+                            rs->color[ index*3 + 0 ]
+                               = brand_colors[ (i+j) % 3 ][0];
+                            rs->color[ index*3 + 1 ]
+                               = brand_colors[ (i+j) % 3 ][1];
+                            rs->color[ index*3 + 2 ]
+                               = brand_colors[ (i+j) % 3 ][2];
+
                             index++;
                         }
                     /* leave everything else empty*/
diff --git xscreensaver-5.11/hacks/glx/sproingies.c xscreensaver-5.11/hacks/glx/sproingies.c
--- xscreensaver-5.11/hacks/glx/sproingies.c
+++ xscreensaver-5.11/hacks/glx/sproingies.c
@@ -113,9 +113,9 @@ build_TopsSides(int wireframe)
 
 	/* Surface: Tops */
 	glNewList(dl_num, GL_COMPILE);
-	mat_color[0] = 0.392157;
-	mat_color[1] = 0.784314;
-	mat_color[2] = 0.941176;
+	mat_color[0] = 0.4218750; /* lighter blue */
+	mat_color[1] = 0.67968750;
+	mat_color[2] = 0.871093750;
 	if (wireframe)
 		glColor3fv(mat_color);
 	else {
@@ -129,9 +129,9 @@ build_TopsSides(int wireframe)
 		glColor3fv(mat_color);
 	else {
       /* jwz: in wireframe mode, color tops and sides the same. */
-      mat_color[0] = 0.156863;
-      mat_color[1] = 0.156863;
-      mat_color[2] = 0.392157;
+		mat_color[0] = 0.00; /* dark blue */
+		mat_color[1] = 0.3359375;
+		mat_color[2] = 0.58203125;
 		glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
 	}
 	glEndList();
diff --git xscreensaver-5.11/utils/colors.c xscreensaver-5.11/utils/colors.c
--- xscreensaver-5.11/utils/colors.c
+++ xscreensaver-5.11/utils/colors.c
@@ -598,6 +598,12 @@ make_uniform_colormap (Display *dpy, Visual *visual, Colormap cmap,
   *ncolorsP = ncolors;
 }
 
+/* Use branding colors first in random colormaps */
+#define NUM_BRANDING_COLORS 4
+static const XColor branding_colors[NUM_BRANDING_COLORS] = {
+	{0x6C00, 0xAE00, 0xDF00},  {0x7600, 0xA100, 0x4100}, 
+	{0x8000, 0x8000, 0x8400},  {0x0000, 0x5600, 0x9500},
+};
 
 void
 make_random_colormap (Display *dpy, Visual *visual, Colormap cmap,
@@ -610,6 +616,7 @@ make_random_colormap (Display *dpy, Visual *visual, Colormap cmap,
   Bool wanted_writable = (allocate_p && writable_pP && *writable_pP);
   int ncolors = *ncolorsP;
   int i;
+  int branding_color_offset = random() % NUM_BRANDING_COLORS;
   Screen *screen = (dpy ? DefaultScreenOfDisplay(dpy) : 0); /* #### WRONG! */
 
   if (*ncolorsP <= 0) return;
@@ -631,9 +638,16 @@ make_random_colormap (Display *dpy, Visual *visual, Colormap cmap,
 	}
       else
 	{
+	  if (i < NUM_BRANDING_COLORS) {
+	      int n = (i + branding_color_offset) % NUM_BRANDING_COLORS;
+	      colors[i].red = branding_colors[n].red;
+	      colors[i].green = branding_colors[n].green;
+	      colors[i].blue = branding_colors[n].blue;
+	  } else {
 	  colors[i].red   = random() % 0xFFFF;
 	  colors[i].green = random() % 0xFFFF;
 	  colors[i].blue  = random() % 0xFFFF;
+	  }
 	}
     }