Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change directory text colour in console from blue to light cyan #197

Merged

Conversation

hemebond
Copy link
Contributor

@hemebond hemebond commented Sep 18, 2024

Updates the console text colour for directories from dark blue to light cyan. Fixed #196

colour-old
colour-new

@hemebond hemebond changed the title Change directory text colour in console from dark to light blue Change directory text colour in console from dark to light cyan Sep 18, 2024
@hemebond hemebond requested a review from Cloudwalk9 September 18, 2024 12:45
@hemebond hemebond changed the title Change directory text colour in console from dark to light cyan Change directory text colour in console from blue to light cyan Sep 18, 2024
Copy link
Contributor

@Cloudwalk9 Cloudwalk9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyan is usually a symlink in ls parlance, but for sheer readability, and given that the Quake VFS doesn't have a concept of symlinks I don't think, LGTM.

@hemebond hemebond merged commit 0c17657 into DarkPlacesEngine:master Sep 18, 2024
1 of 2 checks passed
@hemebond hemebond deleted the fix/jo-196-console-dir-colour branch September 18, 2024 15:05
@drjaska
Copy link
Contributor

drjaska commented Nov 6, 2024

This is not a proper fix for the issue as this dark shade of blue remains unreadable everywhere else. This also breaks the DECADES long default colours of UNIX where directories are blue and symlinks are cyan. The proper fix would be to change the shade of the blue to a lighter colour as it has readability issues in several other places. Please consider reverting this and doing a proper fix.

@hemebond
Copy link
Contributor Author

hemebond commented Nov 7, 2024

@drjaska Happy to implement an alternative solution if I can figure out what that is and how to do it. Can you please provide some sort of guidance on what your solution would be and what problems you see with the current colour change?

drjaska added a commit to drjaska/DarkPlaces that referenced this pull request Nov 7, 2024
@drjaska
Copy link
Contributor

drjaska commented Nov 7, 2024

I have some unpushed WIP changes but I don't have more time today to work on them. Out of curiosity, @hemebond do you use r_textcontrast and/or r_textbrightness or neither?

@hemebond
Copy link
Contributor Author

hemebond commented Nov 8, 2024

I have some unpushed WIP changes but I don't have more time today to work on them. Out of curiosity, @hemebond do you use r_textcontrast and/or r_textbrightness or neither?

I use neither. Both are set to their default values.

@drjaska
Copy link
Contributor

drjaska commented Nov 11, 2024

I managed to find time to finalise #217

hemebond pushed a commit that referenced this pull request Dec 3, 2024
Commits:

- 465d292 Revert "Change directory text colour in console from blue to
light cyan (#197)"
This reverts commit
0c17657.

This was a band-aid fix to a single issue and does not address the root
cause or any of the other issues where the Quake blue colour is not
readable.

- a48ccf0

This is my attempt at making the Quake blue more readable.

---

The changes can be tested for example via `echo
^1aaa^2aaa^3aaa^4aaa^5aaa^6aaa^7aaa^8aaa^9aaa` or `playdemo` tab
completion.

---

`gl_draw.c:862` has the colour definition of blue which is too dark to
be readable in several cases. It is currently set to `#0000FF` in hex,
pure blue. Changing this should be preferred over the change in
#197 as directories
in the console are not the only issue and this avoids making all
directories have the colour of symlinks, breaking the decades long
default UNIX terminal colour theme.

The colour code which (if sys_colortranslation > 0) is output to the
stdout which is often visible on a terminal running the engine gets the
ANSI colour code from `console.c:1367` BUT the user's terminal decides
what colour the colour code is rendered as and thus this doesn't require
any change. If sys_colortranslation == 3 and the terminal supports 24bit
colours then terminal colours are not used but the RGBA colours.

It is worth noting that `cmd.c:669` already includes a hack:
```c
// Work around low brightness and poor legibility of Quake font
"r_textbrightness 0.25\n"
"r_textcontrast 1.25\n"
```
which may affect how your colours are drawn as these values are not the
default values. Mods may also set these. Xonotic uses a different font
and
```quake
r_textbrightness 0.2
r_textcontrast 0.8
```
which I guess is neutral with the math formula in `console.c`:
```c
bound(0, rgb[i] * r_textcontrast.value + r_textbrightness.value * 255, 255);
```
Note that the `r_textcontrast 1.25` hack which I think applies to
vanilla Quake 1 progs looks like it shouldn't actually accomplish
anything due to the 255 bounding except raise the brightness of the
"half brightness" colour. But for some reason changing `r_textcontrast`
to 2 causes a jump in brightness but 2 to 3 or any above ones do not. Is
there something halving the text colour in Quake 1 console? Though after
my change it does affect the shade of blue as it has values which are
not maxed at 1.0 or values like 0 which are not affected by the
multiplication. I would recommend considering removing it.

---

original and a48ccf0 comparisons:

| original | a48ccf0 |
| ------- | ----------- |
| Xonotic | Xonotic |
| DP no progs console r_textbrightness 0 r_textcontrast 1 | DP no progs
console r_textbrightness 0 r_textcontrast 1 |
| DP no progs console r_textbrightness 0.25 r_textcontrast 1.25 | DP no
progs console r_textbrightness 0.25 r_textcontrast 1.25 |



![image](https://github.com/user-attachments/assets/d7e4c809-db82-49f4-b30c-42939d199b7d)

I would not recommend changing the colours globally as there are mods
and users who have already made their colours good and visible. Just
blanket adding 0.25 brightness to all colours causes Xonotic's colours
to look very washed out. Game specific fixes should be encouraged like
the Quake 1 progs and Xonotic ones as they all use different fonts and
lighting (text and screen).

---

I did also look at a patch which bakes in r_textbrightness 0.25 into the
base colours but chose not to include it due to the reasons in previous
chapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark blue directory names illegible in console
3 participants