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

Bright versions of 4-bit color palette #95

Closed
Lassebq opened this issue Sep 12, 2023 · 10 comments
Closed

Bright versions of 4-bit color palette #95

Lassebq opened this issue Sep 12, 2023 · 10 comments
Assignees

Comments

@Lassebq
Copy link

Lassebq commented Sep 12, 2023

Bright versions of 4-bit color palette don't change color of text at all even though they're properly supported by linux TTY.

@cosmos72
Copy link
Owner

Hello @Lassebq,
this happens for both foreground and background colors, or only for one of them (and in case, which) ?

@Lassebq
Copy link
Author

Lassebq commented Sep 13, 2023

Both foreground and background.

@Lassebq
Copy link
Author

Lassebq commented Sep 13, 2023

Also happens when running inside of graphical environment, so it's not specific to TTY

@cosmos72
Copy link
Owner

cosmos72 commented Sep 14, 2023

Hmm, any chance that by "bright versions of 4-bit color palette" you mean the escape sequences
ESC [ 90 m ... ESC [ 97 m for foreground colors, and ESC [ 100 m ... ESC [ 107 m for background colors?

Twin currently does not support them, and instead uses ESC [ 1 m i.e. "bold or high intensity" to enable bright foreground colors, and ESC [ 5 m i.e. "blink" to enable bright background colors.

Anyway, it makes sense to also support ESC [ 90 m ... ESC [ 97 m and ESC [ 100 m ... ESC [ 107 m - I'll try to implement them if I have time.

@cosmos72 cosmos72 self-assigned this Sep 14, 2023
@Lassebq
Copy link
Author

Lassebq commented Sep 15, 2023

Yes, that's the sequences.

@cosmos72
Copy link
Owner

Implemented in commit 436e6e5

@Lassebq
Copy link
Author

Lassebq commented Sep 17, 2023

image
Still no colors. Running latest git commit.

@Lassebq
Copy link
Author

Lassebq commented Sep 17, 2023

image
No colors in a graphical environment either.

@cosmos72
Copy link
Owner

cosmos72 commented Sep 21, 2023

neofetch first draws a line containing normal intensity colors - visible in the sceenshot above - using ESC[40m ... ESC[47m.
Then it draws another line exactly under it, containing bright colors using ESC[48;5;8m ... ESC[48;5;15m
You can check it yourself by redirecting neofetch output to a file.

Twin does not support the 8-bit palette color escape sequences ESC[48;5;<N>m
nor the 24-bit truecolor escape sequences ESC[48;2;<R>;<G>;<B>m
(see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
and https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit for reference)
although it could in theory support at least the sequences ESC[48;5;0m ... ESC[48;5;15m
because they are supposed to be simply the basic 4-bit colors followed by their bright versions.

@cosmos72
Copy link
Owner

cosmos72 commented Sep 21, 2023

I have implemented minimal support for ESC[38;5;<N>m (set foreground color, 8-bit palette)
and ESC[48;5;<N>m (set background color, 8-bit palette).

The only supported values of <N> are 0..15, since they correspond to the same 4-bit palette that can be accessed with older escape sequences.

Higher values of <N> require an 8-bit color palette, which twin currently does not support.

Neofetch now shows bright colors too:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants