summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bin/scheme.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/scheme.c b/bin/scheme.c
index 920ebc74..9acb2e31 100644
--- a/bin/scheme.c
+++ b/bin/scheme.c
@@ -175,13 +175,17 @@ static void outputMintty(const struct HSV *hsv, uint len) {
 }
 
 static void outputCSS(const struct HSV *hsv, uint len) {
+	printf(":root {\n");
 	for (uint i = 0; i < len; ++i) {
 		struct RGB rgb = convert(hsv[i]);
+		printf("\t--ansi%u: #" FORMAT_RGB ";\n", i, rgb.r, rgb.g, rgb.b);
+	}
+	printf("}\n");
+	for (uint i = 0; i < len; ++i) {
 		printf(
-			".fg%u { color: #" FORMAT_RGB "; }\n"
-			".bg%u { background-color: #" FORMAT_RGB "; }\n",
-			i, rgb.r, rgb.g, rgb.b,
-			i, rgb.r, rgb.g, rgb.b
+			".fg%u { color: var(--ansi%u); }\n"
+			".bg%u { background-color: var(--ansi%u); }\n",
+			i, i, i, i
 		);
 	}
 }