sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.83k stars 164 forks source link

Add palette previews #164

Closed Aonodensetsu closed 1 year ago

Aonodensetsu commented 1 year ago

This PR adds full palette previews with colors extracted from the vim file, autogenerated using my own script. This aims to fix #149. The preview files were uploaded to GitHub User Content to not take up disk space for users installing the themes into vim.

As I said, the colors were extracted from the files, so their names match highlight group names and a few are missing. I am available for any further help regarding this improvement.

antoineco commented 1 year ago

These look really cool, thanks! 👍 Maybe we could have the palettes in the same table cells as the screenshots?

sainnhe commented 1 year ago

Wow, this is really cool!

Maybe we could have the palettes in the same table cells as the screenshots?

Agree. Or we can place the palette table below the preview table?

sainnhe commented 1 year ago

LGTM. Thanks!

Visual-Dawg commented 1 year ago

To allow for easy copying of the values, you could create an svg with the text and colors. For that the property foreignObject is used and it works for Github.

Aonodensetsu commented 1 year ago

working on svg generation, python doesn't really have any good libraries for it but i've figured something out

Aonodensetsu commented 1 year ago

done, although the font does not display correctly in raws (CSP restricted lol) and I still can't select text while in markdown, although it does work everywhere else

Visual-Dawg commented 1 year ago

@Aonodensetsu You can embed the font as base64. Check out this for example. For selecting, I think adding the info that opening the image, allows you to copy the values.

Aonodensetsu commented 1 year ago

it's embedded, github raws' CSP blocks inline

Visual-Dawg commented 1 year ago

Why does it work here though

Aonodensetsu commented 1 year ago

i don't think you sent the correct link, can't see any svgs there

antoineco commented 1 year ago

@Aonodensetsu at the top of their README:

banner
Aonodensetsu commented 1 year ago

also does not work so i don't get the comment

Visual-Dawg commented 1 year ago

@Aonodensetsu cant you select the text when you open the image by clicking on it? Im confused, what is not working?

Aonodensetsu commented 1 year ago

works the same way as mine, cannot select while in markdown view and the font does not work in raw view

Visual-Dawg commented 1 year ago

Ah I see. You can also just specify font-family: Sans-Serif;. In that way it will use the system font, which should look decent enough. Im not sure why the raw view matters though. And you can just add a small hint to the image like "Open me to copy text". But sure, when creating the svg becomes a lot of work, then dont, it was just a suggestion of mine after all :D

Aonodensetsu commented 1 year ago

i'm just annoyed it looks bad because of CSP, it doesn't bother me that much, i get XSS protection but blocking fonts?

Visual-Dawg commented 1 year ago

Yes thats understandable. font-family: Sans-Serif; works luckily

Aonodensetsu commented 1 year ago

i added the fallback (¬_¬), annoyed me enough after all