shithub: patch

ref: 6ed9362e5e1e68acbda5de1f1f9ada33a0dcb2e6
dir: /stats-col/

View raw version
diff -r 034743cc4f9f sys/src/cmd/stats.c
--- a/sys/src/cmd/stats.c	Thu Jun 14 21:54:42 2018 +0200
+++ b/sys/src/cmd/stats.c	Sun Jun 17 07:30:50 2018 +0200
@@ -208,6 +208,7 @@
 };
 
 Image	*cols[Ncolor][3];
+Image	*txt;
 Graph	*graph;
 Machine	*mach;
 char	*mysysname;
@@ -271,30 +272,23 @@
 }
 
 void
-mkcol(int i, int c0, int c1, int c2)
+mkcol(int i, int c0, int c1)
 {
-	cols[i][0] = allocimagemix(display, c0, DWhite);
-	cols[i][1] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, c1);
-	cols[i][2] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, c2);
+	cols[i][0] = allocimagemix(display, c0, DBlack);
+	cols[i][1] = allocimagemix(display, 0x773300FF, c1);
+	cols[i][2] = allocimage(display, Rect(0,0,1,1), RGB24, 1, c1);
 }
 
 void
 colinit(void)
 {
-	/* Peach */
-	mkcol(0, 0xFFAAAAFF, 0xFFAAAAFF, 0xBB5D5DFF);
-	/* Aqua */
-	mkcol(1, DPalebluegreen, DPalegreygreen, DPurpleblue);
-	/* Yellow */
-	mkcol(2, DPaleyellow, DDarkyellow, DYellowgreen);
-	/* Green */
-	mkcol(3, DPalegreen, DMedgreen, DDarkgreen);
-	/* Blue */
-	mkcol(4, 0x00AAFFFF, 0x00AAFFFF, 0x0088CCFF);
-	/* Grey */
-	cols[5][0] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xEEEEEEFF);
-	cols[5][1] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xCCCCCCFF);
-	cols[5][2] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x888888FF);
+	mkcol(0, 0x994400FF, 0x442200FF);
+	mkcol(1, 0x993C00FF, 0x441F00FF);
+	mkcol(2, 0x993300FF, 0x441C00FF);
+	mkcol(3, 0x992200FF, 0x441800FF);
+	mkcol(4, 0x991100FF, 0x441400FF);
+	mkcol(5, 0x990000FF, 0x441100FF);
+	txt = allocimage(display, Rect(0,0,1,1), RGB24, 1, 0x441100FF);
 }
 
 int
@@ -437,7 +431,7 @@
 		g->overflow = 1;
 		draw(g->overtmp, g->overtmp->r, screen, nil, g->overtmp->r.min);
 		sprint(buf, "%llud", v);
-		string(screen, g->overtmp->r.min, display->black, ZP, font, buf);
+		string(screen, g->overtmp->r.min, txt, ZP, font, buf);
 	}
 }
 
@@ -1094,7 +1088,7 @@
 	uvlong v, vmax;
 	char buf[128], labs[Nlab][Lablen];
 
-	draw(screen, screen->r, display->white, nil, ZP);
+	draw(screen, screen->r, display->black, nil, ZP);
 
 	/* label left edge */
 	x = screen->r.min.x;
@@ -1123,7 +1117,7 @@
 			snprint(buf, sizeof buf, "%.*s(%d)", j, mach[i].shortname, n);
 		}else
 			snprint(buf, sizeof buf, "%.*s", j, mach[i].shortname);
-		string(screen, Pt(x+Labspace, screen->r.min.y + Labspace), display->black, ZP, font, buf);
+		string(screen, Pt(x+Labspace, screen->r.min.y + Labspace), txt, ZP, font, buf);
 	}
 
 	maxx = screen->r.max.x;
@@ -1148,7 +1142,7 @@
 					ly = y + (dy*(nlab-k)/(nlab+1));
 					draw(screen, Rect(maxx+1, ly, maxx+1+Lx, ly+1), display->black, nil, ZP);
 					ly -= font->height/2;
-					string(screen, Pt(maxx+1+Lx, ly), display->black, ZP, font, labs[k]);
+					string(screen, Pt(maxx+1+Lx, ly), txt, ZP, font, labs[k]);
 				}
 			}
 		}