eylles / pywal16

16 colors fork of pywal
MIT License
157 stars 24 forks source link

Main / accent color #61

Closed Reyshyram closed 1 month ago

Reyshyram commented 1 month ago

Is there any way to obtain the "main" color of the wallpaper (the color that stands out the most)? I’m currently using color9 but the color that represents the wallpaper the most isn’t always at the same position.

eylles commented 1 month ago

ah, well there is nothing really guaranteed with how pywal works, but usually the accent color of the colorscheme ends up in the color4/color12 with the "secondary" accent color being color2/color10

or at least that is the intention as that is the pattern followed by every piece of pywal based themeing written by dylanaraps (the original author of pywal)

Reyshyram commented 1 month ago

Ok, thank you! I will try it tomorrow, might try to create a script if this still isn’t accurate enough

Reyshyram commented 1 month ago

Finished a script, it's ugly but it works https://gist.github.com/Reyshyram/a44ffa52ff06e3bd51905cd22cd500fd

eylles commented 1 month ago

>is ugly but it works
that describes 99% of what i write

correct me if i'm wrong, but the script replaces whatever color ended up in the place of the "accent" color in the built templates with the actual accent calculated by the script.

Reyshyram commented 1 month ago

That’s right, I just had to modify some default templates to add {{accent}}

eylles commented 1 month ago

hmmm i wonder how difficult would it be to retrofit the accent calculation into pywal16.

Reyshyram commented 1 month ago

Well, with the way it’s actually coded it would introduce multiple dependencies, and it may not the fastest nor the most precise. It will most likely need to be improved if you consider bringing a similar functionality into pywal16

eylles commented 1 month ago

>it won't the be fastest nor most precise
pywal16 is written in python, if anything the slowness is a feature.

Reyshyram commented 1 month ago

Yeah it’s true, though with caching it’s a lot better