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

Can you change what colours are used for the black and white values? #1820

Closed
Kirtai opened this issue Sep 2, 2024 · 11 comments
Closed

Can you change what colours are used for the black and white values? #1820

Kirtai opened this issue Sep 2, 2024 · 11 comments

Comments

@Kirtai
Copy link

Kirtai commented Sep 2, 2024

Hi
I was wondering if it was possible to change what colours are used for the on-screen black and white display values.
e.g. have Maiko map Medley's black and white to e.g. cream and very dark grey on-screen.

@nbriggs
Copy link
Contributor

nbriggs commented Sep 2, 2024

As it stands today, there's no option to change the "black" and "white" colors - Under X11, it unconditionally uses the XLib BlackPixelOfScreen() and WhitePixelOfScreen().

I know that at one point someone tried changing it to take a -fg/-bg for the colors, but it did not work properly (probably didn't find all the dependencies on black/white), so we dropped that code mod.

It's something we could go back and look at again, and it might be easier to get working with SDL.

If the reason behind the request, though, is to make the cursor stand out more -- use the X11 version (ldex) and -cursorColor xxxx (my ~/.Xresources has ldex*cursorColor: red and that works very nicely)

@nbriggs
Copy link
Contributor

nbriggs commented Sep 2, 2024

I've hacked at it for a bit, it's not clean, but this is a proof-of-concept, and only for the X11 display version. It'll take X11 named color specs for foreground and background. It uses the same colors for the main X11 window and the scroll bar etc. - every color that would have been white is now the background color, likewise all black is now foreground color. A call to (VIDEOCOLOR T) will invert ONLY the colors used in the main display, not the scrollbars. Is this the sort of thing you're looking for?

% cd medley && ./run-medley  -m 32 -g 1200x700 -sc 1200x700 -fg lightGoldenrod  -bg dimgrey loadups/full.sysout

Screenshot 2024-09-02 at 12 08 53 PM

@Kirtai
Copy link
Author

Kirtai commented Sep 2, 2024

I've hacked at it for a bit, it's not clean, but this is a proof-of-concept, and only for the X11 display version. It'll take X11 named color specs for foreground and background. It uses the same colors for the main X11 window and the scroll bar etc. - every color that would have been white is now the background color, likewise all black is now foreground color. A call to (VIDEOCOLOR T) will invert ONLY the colors used in the main display, not the scrollbars. Is this the sort of thing you're looking for?

Yes, that's exactly what I'm looking for, thanks :)

@nbriggs
Copy link
Contributor

nbriggs commented Sep 4, 2024

@Kirtai - If you're comfortable building the maiko code from source you could try building from the nhb-display-colors-choice branch of Interlisp/maiko -- I have both the X11 and SDL versions working reasonably, I think. Both will take a -fg/-bg (or -foreground/-background) with a color name (from the X11 color set) or a 6 hex digit color as #rrbbgg

@Kirtai
Copy link
Author

Kirtai commented Sep 10, 2024

Thank you, this is really nice and much appreciated :)

Only one thing is missing and that is support in the medley helper script.

@nbriggs
Copy link
Contributor

nbriggs commented Sep 10, 2024

@Kirtai Frank is going to add them to the medley helper script as known options, but in the meantime you can throw in -- followed by arbitrary options that get passed on to lde, so, for example, (from the medley directory) ./medley --sysout loadups/full.sysout -- -fg white -bg darkgray would work.

@Kirtai
Copy link
Author

Kirtai commented Sep 10, 2024

That worked perfectly, thank you :)

@masinter
Copy link
Member

@Kirtai Just curious,..... what colors do you use and why?

@Kirtai
Copy link
Author

Kirtai commented Sep 10, 2024

Orignally I just wanted to make the contrast less harsh and reduce the blue a bit to make it easier on my eyes, especially at night.

Right now I have

-bg "#fff5f0" -fg "#202000"

but I need to experiment more with it to see what's comfortable in the long term. It already feels a lot better than the stark black and white.

(a terminal like amber/green plus very dark grey looks nice but I don't know how useable it'll be)

@pamoroso
Copy link
Contributor

This feature is gaining appreciation and interest. Yesterday I shared on Mastodon a screenshot of Medley with different colors and so far it got 35 likes and 14 reshares. A comment by requiem 🏴:

this is beautiful.

and by Tomáš:

this is the most beautiful thing I’ve ever seen.

@nbriggs
Copy link
Contributor

nbriggs commented Sep 16, 2024

Implementation addressed by PR Interlisp/maiko#511

@nbriggs nbriggs closed this as completed Sep 16, 2024
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

No branches or pull requests

4 participants