shithub: vexed

Download patch

ref: 62c8c846fb32c99ed496fbda8c4baa46dcb42549
parent: 5a2d78f14e4c179c9ec1e337e184def382259463
author: phil9 <[email protected]>
date: Fri Dec 30 14:04:23 EST 2022

fix dark color scheme

	some colors were off compared to what rio does in -b mode

--- a/a.h
+++ b/a.h
@@ -54,6 +54,8 @@
 	ADDR,
 	HEX,
 	ASCII,
+	HHEX,
+	HIGH,
 	SCROLL,
 	NCOLS,
 };
--- a/cols.c
+++ b/cols.c
@@ -13,6 +13,8 @@
 		cols[ADDR]   = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
 		cols[HEX]    = display->white;
 		cols[ASCII]  = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
+		cols[HHEX]	 = display->black;
+		cols[HIGH]	 = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
 		cols[SCROLL] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x999999FF^reverse);
 	}else{
 		cols[BACK]   = display->white;
@@ -19,6 +21,8 @@
 		cols[ADDR]   = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DGreygreen);
 		cols[HEX]    = display->black;
 		cols[ASCII]  = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DGreygreen);
+		cols[HHEX]	 = display->black;
+		cols[HIGH]   = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xCCCCCCFF);
 		cols[SCROLL] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x999999FF);
 	}
 }
--- a/vexed.c
+++ b/vexed.c
@@ -407,7 +407,7 @@
 		s = isprint(buf.data[index + i]) ? (char*)&buf.data[index + i] : ".";
 		selected = isselected(index + i);
 		if(selected){
-			p = stringnbg(screen, p, cols[BACK], ZP, font, b, n, cols[HEX], ZP);
+			p = stringnbg(screen, p, cols[HHEX], ZP, font, b, n, cols[HIGH], ZP);
 			p2 = stringnbg(screen, p2, cols[BACK], ZP, font, s, 1, cols[ASCII], ZP);
 		}else{
 			p = stringn(screen, p, cols[HEX], ZP, font, b, n);
@@ -421,7 +421,7 @@
 				hs = index + i != sel;
 		}
 		if(hs)
-			p = stringnbg(screen, p, cols[BACK], ZP, font, " ", 1, cols[HEX], ZP);
+			p = stringnbg(screen, p, cols[BACK], ZP, font, " ", 1, cols[HIGH], ZP);
 		else
 			p = stringn(screen, p, cols[BACK], ZP, font, " ", 1);
 	}
@@ -802,7 +802,7 @@
 	reverse = 0;
 	ARGBEGIN{
 	case 'b':
-		reverse = 1;
+		reverse = ~0xFF;
 		break;
 	default:
 		usage();