Repository: jqlang/jq

Problem statement:
Default color of jq is indistinguishable under Solarized Light background
<!--
READ THIS FIRST!

If you have a usage question, please ask us on [Stack Overflow](https://stackoverflow.com/questions/tagged/jq), in the [#jq channel](https://web.libera.chat/#jq) on [Libera.Chat](https://libera.chat/), or in our [Discord server](https://discord.gg/yg6yjNmgAC).

-->

**Describe the bug**
Since jq 1.7, its default color is very hard to read when using Solarized Light.

**To Reproduce**

Tilix 1.9.5, with Solarized Light color scheme.

```
> echo '{"a": 1, "b": "b", "c": [1,2,3,4,5]}' | jq .
```

![image](https://github.com/jqlang/jq/assets/2109893/68a5acca-4d8f-46e4-879f-e73bd2d0c72a)

**Expected behavior**

Clean output like jq 1.6.

**Environment (please complete the following information):**

- OS and Version: Arch Linux
- jq version 1.7

**Additional context**

~~This may be caused by https://github.com/jqlang/jq/pull/2824.~~


Hints:
#2824 does not change the color of numbers. Could you share the screenshot of the same command with jq 1.6?
jq 1.6:

![image](https://github.com/jqlang/jq/assets/2109893/54bab3bd-61fd-48f7-9a74-506d4a72951f)

I'm also bisecting jq's code and I would comment here if I have found out that commit.
It's https://github.com/jqlang/jq/commit/07b18a33feb6ccab08be221657e19b82abf0d84e.
This works correctly within Solarized Light:

```
> echo '{"a": 1, "b": "b", "c": [1,2,3,4,5]}' | JQ_COLORS="1;30:0;39:0;39:0;39:0;32:1;39:1;39" jq .
```

(Screenshot is the same as jq 1.6).

Guess that this commit should be reverted...

Patch:
diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml
index ac1abad2b2..6ce8233c7d 100644
--- a/docs/content/manual/manual.yml
+++ b/docs/content/manual/manual.yml
@@ -3677,7 +3677,7 @@ sections:
         - color for object keys
 
       The default color scheme is the same as setting
-      `JQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34"`.
+      `JQ_COLORS="0;90:0;39:0;39:0;39:0;32:1;39:1;39:1;34"`.
 
       This is not a manual for VT100/ANSI escapes.  However, each of
       these color specifications should consist of two numbers separated
diff --git a/docs/content/manual/v1.6/manual.yml b/docs/content/manual/v1.6/manual.yml
index 0a3d6002a2..553e7b28f6 100644
--- a/docs/content/manual/v1.6/manual.yml
+++ b/docs/content/manual/v1.6/manual.yml
@@ -3343,7 +3343,7 @@ sections:
         - color for objects
 
       The default color scheme is the same as setting
-      `"JQ_COLORS=1;30:0;37:0;37:0;37:0;32:1;37:1;37"`.
+      `"JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39"`.
 
       This is not a manual for VT100/ANSI escapes.  However, each of
       these color specifications should consist of two numbers separated
diff --git a/jq.1.prebuilt b/jq.1.prebuilt
index 3c65674849..a421a502cb 100644
--- a/jq.1.prebuilt
+++ b/jq.1.prebuilt
@@ -1,5 +1,5 @@
 .
-.TH "JQ" "1" "August 2023" "" ""
+.TH "JQ" "1" "September 2023" "" ""
 .
 .SH "NAME"
 \fBjq\fR \- Command\-line JSON processor
@@ -4058,7 +4058,7 @@ color for object keys
 .IP "" 0
 .
 .P
-The default color scheme is the same as setting \fBJQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34"\fR\.
+The default color scheme is the same as setting \fBJQ_COLORS="0;90:0;39:0;39:0;39:0;32:1;39:1;39:1;34"\fR\.
 .
 .P
 This is not a manual for VT100/ANSI escapes\. However, each of these color specifications should consist of two numbers separated by a semi\-colon, where the first number is one of these:
diff --git a/src/jv_print.c b/src/jv_print.c
index 3723670676..2e6d4d510a 100644
--- a/src/jv_print.c
+++ b/src/jv_print.c
@@ -30,8 +30,8 @@
 static char color_bufs[8][16];
 static const char *color_bufps[8];
 static const char* def_colors[] =
-  {COL("0;90"),    COL("0;37"),      COL("0;37"),     COL("0;37"),
-   COL("0;32"),    COL("1;37"),      COL("1;37"),     COL("1;34")};
+  {COL("0;90"),    COL("0;39"),      COL("0;39"),     COL("0;39"),
+   COL("0;32"),    COL("1;39"),      COL("1;39"),     COL("1;34")};
 #define FIELD_COLOR (colors[7])
 
 static const char **colors = def_colors;


Test patch:
diff --git a/tests/shtest b/tests/shtest
index ee060e2e08..8a7ba07700 100755
--- a/tests/shtest
+++ b/tests/shtest
@@ -438,18 +438,18 @@ cmp $d/color $d/expect
 ## Default colors, complex input
 $JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color
 {
-  printf '\033[1;37m[\033[1;37m{'
+  printf '\033[1;39m[\033[1;39m{'
   printf '\033[0m\033[1;34m"a"\033['
-  printf '0m\033[1;37m:\033[0m\033['
-  printf '0;37mtrue\033[0m\033[1'
-  printf ';37m,\033[0m\033[1;34m'
-  printf '"b"\033[0m\033[1;37m:\033'
-  printf '[0m\033[0;37mfalse\033'
-  printf '[0m\033[1;37m\033[1;37'
-  printf 'm}\033[0m\033[1;37m,\033['
-  printf '0;37m123\033[0m\033[1;'
-  printf '37m,\033[0;90mnull\033'
-  printf '[0m\033[1;37m\033[1;37'
+  printf '0m\033[1;39m:\033[0m\033['
+  printf '0;39mtrue\033[0m\033[1'
+  printf ';39m,\033[0m\033[1;34m'
+  printf '"b"\033[0m\033[1;39m:\033'
+  printf '[0m\033[0;39mfalse\033'
+  printf '[0m\033[1;39m\033[1;39'
+  printf 'm}\033[0m\033[1;39m,\033['
+  printf '0;39m123\033[0m\033[1;'
+  printf '39m,\033[0;90mnull\033'
+  printf '[0m\033[1;39m\033[1;39'
   printf 'm]\033[0m\n'
 } > $d/expect
 cmp $d/color $d/expect