sainnhe / edge

Clean & Elegant Color Scheme inspired by Atom One and Material
MIT License
860 stars 56 forks source link

Color Palette difference between `README.md` and `autoload/edge.vim` #73

Closed doprz closed 1 year ago

doprz commented 1 year ago

Hi, first of all, I have to say that great job with your color themes/palettes. I've enjoyed using them quite a bit!

I noticed that the colors displayed on the README.md and autoload/edge.vim differ slightly. Are these changes on purpose?

Edge Dark: README.md autoload/edge.vim
"gray_dim": "#535C6A" "bg_grey": "#828A98"
"gray": "#758094"

I noticed that this issue is persistent throughout all of the displayed themes/variations.

I'm currently working on a project called dipc - "Convert your favorite images and wallpapers with your favorite color palettes/themes" and I've implemented a couple of your themes.

antoineco commented 1 year ago

@Aonodensetsu probably an issue while generating the overview pictures?

Aonodensetsu commented 1 year ago

conversion imprecision within Python I'd assume, not much I can do about it unless some other color conversion library exists

some color names were also changed in the README since the originals were not obvious, so you might be comparing the wrong values?

might also be a relic of an older version, i generated the palettes for gruvbox-material pretty early in development, let me check tomorrow if it was a bug

doprz commented 1 year ago

What tool did you use to generate the palettes?

I double-checked the values and made sure it was the same palette.

Thank you.

Aonodensetsu commented 1 year ago

i made a python program for palette generation, it's in a repository on my profile (prev_gen)

doprz commented 1 year ago

Cool!

Do you mind if I create a similar tool as a CLI using Rust so that I may be able to create palette previews for dipc? I would keep it under the same license and credit you as the source of inspiration.

Aonodensetsu commented 1 year ago

what I made is easily importable so you shouldn't need a rewrite but feel free, maybe rust is more accurate

py -c "from prev_gen import Preview; Preview($1, save=True)" should do it in the cli

doprz commented 1 year ago

Yes, however, one of my reasons for "rewriting" it is that I've been enjoying writing Rust code and it would also make it easier to use as a utility within dipc as it is written in Rust too.

Aonodensetsu commented 1 year ago

you'll have to replace the libraries ofc but feel free to look at the source, maybe you'll like some of the data structures or lazyloaded color conversions

Aonodensetsu commented 1 year ago

i found no difference, one color (bg_grey) is omitted because it didn't fit in a nice grid, it's similar to one of the bg colors anyway

checked with py -c "from prev_gen import Reverse; print(list(j.hex for i in Reverse('edgelight.png') for j in i))"

antoineco commented 1 year ago

@doprz did you double check? If there are differences between the README and Vim palette (aside from the omitted bg_grey), could you please list them in a clear format, such as the one below?

I didn't quite get what the spotted difference was from your original message.

https://github.com/sainnhe/edge/blob/358cb6688ac577470a4eafcb53bdd63899dfc937/autoload/edge.vim#L119-L123

Aonodensetsu commented 1 year ago

i checked the code and hex has a perfect conversion to rgb (since it's just a different representation) and the palettes were generated from hex, so there should be no difference

i implemented reversal a few updates ago so you can take a generated image and get the code back (not in full, still figuring out if i can somehow encode the settings in the image, might look into steganography for that - already have an idea for 6kb per tile) - but it will give back the full list of colors in hex for now

as mentioned above, the command (a short python script tbh) is py -c "from prev_gen import Reverse; print(Reverse('edgelight.png'))" where edgelight.png is the palette filename

antoineco commented 1 year ago

Closing because this seems like a non-issue but feel free to continue to discussion.

doprz commented 1 year ago

Sorry for the delay in getting back to you.

To summarize the issue, I found that autoload/edge.vim had this value: "bg_grey": "#828A98", while README.md didn't but instead had these two values: "gray_dim": "#535C6A" "gray": "#758094"

After a closer analysis, I realized that the "missing" values weren't missing but instead declared here: https://github.com/sainnhe/edge/blob/358cb6688ac577470a4eafcb53bdd63899dfc937/autoload/edge.vim#L119-L123

This means that for me to add the full-color palette to dipc I would need to add "bg_grey" to the "missing places" here: https://github.com/doprz/dipc/blob/d3d3f41558583e78098b075ed40153357f6bfa3c/src/palettes/edge.json#L9-L10

Would you suggest that I add "bg_grey" or keep it as is (using the colors shown on the README.md)?

On that note, I'm also going to check the other @sainnhe themes in dipc to make sure I didn't miss anything. Thank you for your quick responses!