shithub: patch

ref: 507ddf3a5cb60f52a8bc2b8e013fd333d75208a4
dir: /faces-col/

View raw version
diff -r a620b482772f sys/src/cmd/faces/main.c
--- a/sys/src/cmd/faces/main.c	Sun Mar 18 07:53:10 2018 +0100
+++ b/sys/src/cmd/faces/main.c	Wed Mar 21 02:18:49 2018 +0200
@@ -53,8 +53,10 @@
 	0x18, 0x00, 0x00, 0x10, 0x00
 };
 
-Image	*blue;		/* full arrow */
-Image	*bgrnd;		/* pale blue background color */
+Image	*arrow;		/* full arrow */
+Image	*smallfg;
+Image	*bgrnd;		/* background color */
+Image	*facebg;	/* background for face */
 Image	*left;		/* left-pointing arrow mask */
 Image	*right;		/* right-pointing arrow mask */
 Font	*tinyfont;
@@ -97,11 +99,13 @@
 	initplumb();
 
 	/* make background color */
-	bgrnd = allocimagemix(display, DPalebluegreen, DWhite);
-	blue = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x008888FF);	/* blue-green */
+	bgrnd = display->black;
+	arrow = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x550000FF);
+	smallfg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF);
+	facebg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xCCCCCCFF);
 	left = allocimage(display, leftright, GREY1, 0, DWhite);
 	right = allocimage(display, leftright, GREY1, 0, DWhite);
-	if(bgrnd==nil || blue==nil || left==nil || right==nil){
+	if(bgrnd==nil || arrow==nil || smallfg == nil || facebg == nil || left==nil || right==nil){
 		fprint(2, "faces: can't create images: %r\n");
 		exits("image");
 	}
@@ -113,7 +117,7 @@
 	tinyfont = openfont(display, "/lib/font/bit/misc/ascii.5x7.font");
 	if(tinyfont == nil)
 		tinyfont = font;
- 	mediumfont = openfont(display, "/lib/font/bit/misc/unicode.6x13.font");
+ 	mediumfont = openfont(display, "/lib/font/bit/vga/unicode.font");
  	if(mediumfont == nil)
  		mediumfont = font;
 	datefont = font;
@@ -138,7 +142,7 @@
 	r.max.x = enddate.x;
 	r.max.y = enddate.y+datefont->height;
 	draw(screen, r, bgrnd, nil, ZP);
-	string(screen, r.min, display->black, ZP, datefont, date);
+	string(screen, r.min, smallfg, ZP, datefont, date);
 }
 
 void
@@ -257,18 +261,19 @@
 		return;
 	r = facerect(i-first);
 	draw(screen, r, bgrnd, nil, ZP);
+	draw(screen, Rpt(r.min, addpt(r.min, Pt(Facesize, Facesize))), facebg, nil, ZP);
 	draw(screen, r, f->bit, f->mask, ZP);
 	r.min.y += Facesize;
-	center(mediumfont, r.min, f->str[Suser], display->black);
+	center(mediumfont, r.min, f->str[Suser], smallfg);
 	r.min.y += mediumfont->height;
 	tstr = facetime(f, &f->recent);
-	center(mediumfont, r.min, tstr, display->black);
+	center(mediumfont, r.min, tstr, facebg);
 	if(f->unknown){
 		r.min.y -= mediumfont->height + tinyfont->height + 2;
 		for(p.x=-1; p.x<=1; p.x++)
 			for(p.y=-1; p.y<=1; p.y++)
-				center(tinyfont, addpt(r.min, p), f->str[Sdomain], display->white);
-		center(tinyfont, r.min, f->str[Sdomain], display->black);
+				center(tinyfont, addpt(r.min, p), f->str[Sdomain], display->black);
+		center(tinyfont, r.min, f->str[Sdomain], facebg);
 	}
 }
 
@@ -307,8 +312,8 @@
 	leftr = rectaddpt(leftright, p);
 	p.x += Dx(leftright) + Facesep;
 	rightr = rectaddpt(leftright, p);
-	draw(screen, leftr, first>0? blue : bgrnd, left, leftright.min);
-	draw(screen, rightr, last<nfaces? blue : bgrnd, right, leftright.min);
+	draw(screen, leftr, first>0? arrow : bgrnd, left, leftright.min);
+	draw(screen, rightr, last<nfaces? arrow : bgrnd, right, leftright.min);
 }
 
 void