projekt0n / github-nvim-theme

Github's Neovim themes
MIT License
2.02k stars 104 forks source link

Any colorscheme that looks like github code viewer? #298

Closed NikoKS closed 7 months ago

NikoKS commented 9 months ago

Hello, Thank you very much for this theme!

I was wondering if there is a colorscheme that match Github's native dark default code viewer? Here is a sample screenshot what it looks like:

Screenshot 2023-09-20 at 11 24 52

I found that github_dark_dimmed is too light, and github_dark_high_contrast is too dark. Github's native dark default sits just right in the middle.

tmillr commented 9 months ago

hmmmm this is interesting. It may be because the bg is currently being derived (in a sort of manual fashion?) from the scale colors (and this may have been correct before but maybe the scale colors got changed/updated by github).

https://github.com/projekt0n/github-nvim-theme/blob/bf4cd7e05ff1ac9a301edcd5051b9cd7f5c81f0d/lua/github-theme/palette/github_dark.lua#L46


I have submitted a pr which should fix this. Once it is merged just update your plugin (to the latest main/master/HEAD), and then you can just use gitHub_dark.

[!NOTE] After updating the plugin, you may need to force an update of the cache with :GithubThemeCompile, and then restart nvim.

NikoKS commented 9 months ago

Thank you for the quick response @tmillr! looking forward the PR being merged.

ful1e5 commented 9 months ago

Thanks, @tmillr for the PR! I appreciate your work on this issue.

The patched theme's canvas color is noticeably darker, almost like the github_dark_default. I'm not sure if this is a bug in the primer/primitives or if we're missing something.

Upstream

Patch

tmillr commented 9 months ago

The patched theme's canvas color is noticeably darker, almost like the github_dark_default. I'm not sure if this is a bug in the primer/primitives or if we're missing something.

hmmm do you mean in comparison to GitHub.com (the center window), or to what it was before the patch (i.e. topleft vs bottomleft)?

As for the former, on the bottom img, the bg of the left and center window match.

If you mean the latter (which I think is probably what you meant?), well for me here on the website while using the regular dark "theme" (i.e. Dark default) that is indeed the correct bg of the code viewer it seems:

Screenshot 2023-09-23 at 1 17 42 PM

It is close to the same color used for dark high contrast, but it is not the same color, it is just a touch lighter. This is correct (as far as matching the website) and is just what GitHub has decided to go with.

So it looks correct to me (based off this), if the goal is to match the colors of GitHub.com precisely. It just seems like GitHub chose 2 very similar bg colors for regular dark and dark high contrast.

[!NOTE] I used a color meter.


On a somewhat unrelated note, it looks like github_dark_default in the plugin is the deprecated one yeah? I often get confused and forget whether it's github_dark or github_dark_default that is the deprecated one, so perhaps the deprecated one should be planned for removal? I also don't receive the deprecation message for some reason when I set the colorscheme to it, so maybe that's something we should look into as well?

tmillr commented 9 months ago

For reference, here's dark high contrast on the website:

Screenshot 2023-09-23 at 1 48 07 PM

It's very similar to the bg of regular dark, but it's just a pinch darker.

For me, the patch matches both of these respectively.

borisrorsvort commented 9 months ago

The white theme is still different from the codeviewer white theme too

ful1e5 commented 9 months ago

On a somewhat unrelated note, it looks like github_dark_default in the plugin is the deprecated one yeah? I often get confused and forget whether it's github_dark or github_dark_default that is the deprecated one, so perhaps the deprecated one should be planned for removal? I also don't receive the deprecation message for some reason when I set the colorscheme to it, so maybe that's something we should look into as well?

@tmillr It looks like deprecating github_dark_default and github_light_default was an uninformed decision, because after a bit of research, I found that Github Dark and Github Light colors provided from Primer are actually for Github Dark Default and Github Light Default palettes. And Github Dark and Github Light colors in VSCode are legacy colors. So we have to restore this colorscheme. I'll push that restoration once #299 is merged.

NikoKS commented 9 months ago

Just wondering, is there any blocker to #299?

tmillr commented 9 months ago

Sorry I can't merge it, but it should be good to go

tmillr commented 9 months ago

@tmillr It looks like deprecating github_dark_default and github_light_default was an uninformed decision, because after a bit of research, I found that Github Dark and Github Light colors provided from Primer are actually for Github Dark Default and Github Light Default palettes. And Github Dark and Github Light colors in VSCode are legacy colors. So we have to restore this colorscheme. I'll push that restoration once #299 is merged.

Yeah it's hard not to mix it up.

In the web ui they call it Github Dark Default and Github Light Default, but among the primitives files none of them are named *default*, so I'm sure that the dark.* file is for Github Dark Default, and the light.* file for Github Light Default.

i.e.

I believe this is what you're saying as well but just making sure.


I suppose you could either leave it as it is now and remove the *_default versions, or change it so that :colorscheme github_dark_default would be the new way to set and refer to the regular dark theme (the plus being that the name matches up more closely). If the more manual parts of the palettes for these 2 themes were based off the wrong/old themes then I suppose that'd need to be fixed as well. I'd recommend just pulling directly from the primitives as much as possible.

NikoKS commented 7 months ago

@ful1e5, the color is back again after the latest commits

ful1e5 commented 7 months ago

@NikoKS, consider switching your color scheme to github_dark_default to experience the dark color scheme similar to the one on the GitHub Web App.

The github_dark color scheme is now considered a legacy package. For a clearer understanding, please refer to :h github-nvim-theme-overview or visit README.md#supported-colorschemes.