sbarex / SourceCodeSyntaxHighlight

Quick Look extension for highlight source code files on macOS 10.15 and later.
GNU General Public License v3.0
2.88k stars 71 forks source link

macOS Ventura 13.0 inverted theme with RTF engine #202

Open Altair-Bueno opened 1 year ago

Altair-Bueno commented 1 year ago

Summary

RTF engine does not work properly on macOS Ventura

Expected behaviour

Dark colorscheme on dark theme, light colorscheme on light theme

Current behaviour

Dark colorscheme on light theme, light colorscheme on dark theme

Screenshots

SyntaxHighlight config

image

Dark mode disabled

image

Dark mode enabled

image

Additional information

image

System info

sbarex commented 1 year ago

The colors are not inverted. But on dark mode Venura blend the window background color with the rtf colors! For now I do not have a solution. Please use the html engine.

see these links: https://eclecticlight.co/2018/11/14/making-documents-look-good-in-both-appearance-modes/ https://eclecticlight.co/2018/12/06/textedit-1-14-not-the-dark-mode-youd-expect/ https://eclecticlight.co/2018/12/10/rendering-rich-text-in-dark-mode/

ParzivalExe commented 1 year ago

I have the same Problem (which wouldn't be much news). I am writing this comment mainly because it is not simply: If you have Ventura, you have this problem: A friend uses Syntax Highlight with Ventura and has the desired effect (dark-mode shows dark-mode and light-mode shows light-mode). He also uses Apple-Silicon like me, so that is also not the difference.

I have no idea what the difference between both of your systems could be. We even went so far as to AirDrop the App from his Device right onto mine and it still didn't work for me.

Well, I will probably use HTML in the meantime 😉

sbarex commented 1 year ago

If you activate the debug mode, on the desktop a colorize.rtf file will be created. If it is opened in textedit it will have the same problem. To see it normally in textedit you have to deactivate the option "use dark background for windows" on the view menu.

Apple unfortunately does not document rtf syntax for the color styles for light and dark themes.

cpsauer commented 1 year ago

Perhaps we should switch the default to HTML until we figure out a fix?

Altair-Bueno commented 1 year ago

Totally forgot about this issue. HTML engine gave me zero issues for the last 3 months. Switching the default engine temporally looks like a good patch to me

guillemparrado commented 1 year ago

But the HTML engine doesn't render embedded in finder, you need to actually open QuickLook to see what's inside.

A Finder snapshot without SyntaxHighlight:

image

With SyntaxHighlight, RTF engine:

image

With SyntaxHighlight, HTML engine:

image
simioni commented 1 year ago

The HTML animation is also a bit wonky (at least on Ventura 13.3 on M1 Pro). The quick-look preview starts out as white, and the HTML rendering engine only gets to paint it dark a couple frames after the animation has already started. It doesn't look smooth.

What worked for me to fix the colors on the RTS engine was setting a light theme for the dark color scheme of Syntax Highlighter (basically inverting the colors in the preferences).

Screenshot 2023-04-06 at 10 47 50 AM
MatisseHack commented 1 year ago

What worked for me to fix the colors on the RTS engine was setting a light theme for the dark color scheme of Syntax Highlighter (basically inverting the colors in the preferences).

Oh, that worked! Setting a dark color scheme in light mode wasn't enough, but setting a light color scheme in dark mode seems to have fixed it!

learn2reid commented 1 year ago

Does someone have an inverse light mode scheme they can share?

EddieLukeAtmey commented 1 year ago

@learn2reid you select the theme right there, click on the filter and select dark content like this

Screenshot 2023-06-21 at 17 09 24

khurshid-alam commented 1 month ago

It didn't exactly work for me. Even though it fixes the color, it is not exactly same like in HTML rendering. In Raycast it just shows wrong color with RTF. And If you press ⌘ + Y to quick look, it opens preview in same wrong color.

This is very troubling issue.

sbarex commented 1 month ago

The RTF engine was useful when the HTML view was plagued by a series of bugs, but with the latest operating system updates you can safely use the HTML engine.

learn2reid commented 3 weeks ago

but html engine doesn't show sidebar previews so this is still a problem :(

sbarex commented 2 weeks ago

what do you mean the html engine doesn't show the preview in the sidebar?

but html engine doesn't show sidebar previews so this is still a problem :(

MikeSuiter commented 2 weeks ago

what do you mean the html engine doesn't show the preview in the sidebar?

I having the same problem with no preview in the sidebar using HTML render.

image