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

If Glk can't measure colours, should not set foreground and background to the same colour #3

Open
curiousdannii opened this issue Nov 27, 2021 · 0 comments
Labels
bug Something isn't working glk

Comments

@curiousdannii
Copy link
Contributor

curiousdannii commented Nov 27, 2021

tads-runner/osglk.c

Lines 149 to 154 in 36b263a

/* get default colors for main window */
if (!glk_style_measure(mainwin, style_Normal, stylehint_TextColor, &mainfg))
mainfg = 0;
if (!glk_style_measure(mainwin, style_Normal, stylehint_BackColor, &mainbg))
mainbg = 0;

For a Glk library like Remglk, it doesn't currently support measuring styles. I'm not sure if any support will be possible. In this case, TADS sets both mainfg and mainbg to black, which is not ideal. If we can't detect the colours we should at least set contrasting colours, like black on white.

Or alternatively set them to a value indicating unknown, and avoid using them in the future. It appears that they are really only used to set style_User1 to reverse mode, instead of sending an actual reverse stylehint. Is this even useful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working glk
Projects
None yet
Development

No branches or pull requests

1 participant