NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wsconst changing forground/background colors



Try the patch below to get "dim" colours throughout. Had to
modify the kernel because a) there's no rasops_put_cmap()
and b) ioctl(WSDISPLAYIO_PUTCMAP) only seems to work for
256-colour displays.

Change colours to suit...

---START PATCH---
--- sys/dev/rasops/rasops.c.orig	2019-08-15 12:21:27.000000000 +0000
+++ sys/dev/rasops/rasops.c	2021-10-30 08:25:07.117532906 +0000
@@ -82,30 +82,32 @@

 /* ANSI colormap (R,G,B). Upper 8 are high-intensity */
 const uint8_t rasops_cmap[256 * 3] = {
+	/* dim = normal */
 	0x00, 0x00, 0x00, /* black */
+	0x3f, 0x00, 0x00, /* red */
+	0x00, 0x3f, 0x00, /* green */
+	0x3f, 0x3f, 0x00, /* brown */
+	0x00, 0x00, 0x3f, /* blue */
+	0x3f, 0x00, 0x3f, /* magenta */
+	0x00, 0x3f, 0x3f, /* cyan */
+	0x47, 0x47, 0x47, /* white */
+
+	/* normal = hilit */
+	0x3f, 0x3f, 0x3f, /* grey */
 	0x7f, 0x00, 0x00, /* red */
 	0x00, 0x7f, 0x00, /* green */
 	0x7f, 0x7f, 0x00, /* brown */
 	0x00, 0x00, 0x7f, /* blue */
 	0x7f, 0x00, 0x7f, /* magenta */
 	0x00, 0x7f, 0x7f, /* cyan */
-	0xc7, 0xc7, 0xc7, /* white - XXX too dim? */
+	0xc7, 0xc7, 0xc7, /* white */

-	0x7f, 0x7f, 0x7f, /* black */
-	0xff, 0x00, 0x00, /* red */
-	0x00, 0xff, 0x00, /* green */
-	0xff, 0xff, 0x00, /* brown */
-	0x00, 0x00, 0xff, /* blue */
-	0xff, 0x00, 0xff, /* magenta */
-	0x00, 0xff, 0xff, /* cyan */
-	0xff, 0xff, 0xff, /* white */
-
 	/*
 	 * For the cursor, we need at least the last (255th)
 	 * color to be white. Fill up white completely for
 	 * simplicity.
 	 */
-#define _CMWHITE 0xff, 0xff, 0xff,
+#define _CMWHITE 0x7f, 0x7f, 0x7f,
 #define _CMWHITE16	_CMWHITE _CMWHITE _CMWHITE _CMWHITE \
 			_CMWHITE _CMWHITE _CMWHITE _CMWHITE \
 			_CMWHITE _CMWHITE _CMWHITE _CMWHITE \
@@ -120,23 +122,23 @@
 	 * For the cursor the fg/bg indices are bit inverted, so
 	 * provide complimentary colors in the upper 16 entries.
 	 */
-	0x7f, 0x7f, 0x7f, /* black */
-	0xff, 0x00, 0x00, /* red */
-	0x00, 0xff, 0x00, /* green */
-	0xff, 0xff, 0x00, /* brown */
-	0x00, 0x00, 0xff, /* blue */
-	0xff, 0x00, 0xff, /* magenta */
-	0x00, 0xff, 0xff, /* cyan */
-	0xff, 0xff, 0xff, /* white */
-
-	0x00, 0x00, 0x00, /* black */
+	0x3f, 0x3f, 0x3f, /* grey */
 	0x7f, 0x00, 0x00, /* red */
 	0x00, 0x7f, 0x00, /* green */
 	0x7f, 0x7f, 0x00, /* brown */
 	0x00, 0x00, 0x7f, /* blue */
 	0x7f, 0x00, 0x7f, /* magenta */
 	0x00, 0x7f, 0x7f, /* cyan */
-	0xc7, 0xc7, 0xc7, /* white - XXX too dim? */
+	0xc7, 0xc7, 0xc7, /* white */
+
+	0x00, 0x00, 0x00, /* black */
+	0x3f, 0x00, 0x00, /* red */
+	0x00, 0x3f, 0x00, /* green */
+	0x3f, 0x3f, 0x00, /* brown */
+	0x00, 0x00, 0x3f, /* blue */
+	0x3f, 0x00, 0x3f, /* magenta */
+	0x00, 0x3f, 0x3f, /* cyan */
+	0x47, 0x47, 0x47, /* white */
 };

 /* True if color is gray */
---END PATCH---

-RVP


Home | Main Index | Thread Index | Old Index