JulienMaille / spicetify-dynamic-theme

A theme for Spicetify with support for light/dark modes and album art based colors.
MIT License
265 stars 27 forks source link

Question regarding the inner workings. #51

Closed peperonnii closed 7 months ago

peperonnii commented 8 months ago

Hello, I am customising my linux distro and i am trying to make it so that i could use the colors selected based on the song playing, export that somehow and then use that color (which obviously changes dynamically) for ui elements in things like rofi, polybar, firefox, etc.

What i am trying to figure out is how and where the theme selects its colors, where they are stored, and how i could use them systemwide in the application that i described.

I apologise if it is obvious in the code, I am sort of learning this as i go... Any help would be greatly appreciated but could you please be specific if possible?

Thanks (I really love this theme btw, I cant wait until i implement this lmao)

JulienMaille commented 8 months ago

Hello, cover change is handled here https://github.com/JulienMaille/spicetify-dynamic-theme/blob/914eb1227d11d6c7cd9d63aa002a9ff0cdf618ea/default-dynamic.js#L292-L296 and pickCoverColor will extract a dominant color from the cover in textColor

https://github.com/JulienMaille/spicetify-dynamic-theme/blob/914eb1227d11d6c7cd9d63aa002a9ff0cdf618ea/default-dynamic.js#L272-L283