Any colorscheme that looks like github code viewer?
NikoKS opened this issue ยท 12 comments
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:
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.
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).
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.
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.
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:
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?
The white theme is still different from the codeviewer white theme too
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'sgithub_dark
orgithub_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.
Sorry I can't merge it, but it should be good to go
@tmillr It looks like deprecating
github_dark_default
andgithub_light_default
was an uninformed decision, because after a bit of research, I found thatGithub Dark
andGithub Light
colors provided from Primer are actually forGithub Dark Default
andGithub Light Default
palettes. AndGithub Dark
andGithub 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.
- https://github.com/projekt0n/github-nvim-theme/blob/48f95f763e1a98e508260a20e448c3ff2d91213a/lua/github-theme/palette/primitives/dark.lua
- https://github.com/projekt0n/github-nvim-theme/blob/48f95f763e1a98e508260a20e448c3ff2d91213a/lua/github-theme/palette/primitives/light.lua
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, 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.