FelixKratz / JankyBorders

A lightweight window border system for macOS
GNU General Public License v3.0
1k stars 18 forks source link

[Request] Gradient #19

Closed mizlan closed 9 months ago

mizlan commented 9 months ago

Hi Felix, thanks for making JankyBorders. I was curious if you'd be interested in looking into adding the option of gradient borders, e.g., top right corner is yellow and transitions to green at bottom left corner, or something along those lines.

If you believe that is outside the scope of JankyBorders, I can try to implement it myself (following this), though I would need to familiarize myself with the codebase.

FelixKratz commented 9 months ago

How would the configuration syntax look for a gradient feature? I.e. what would be required to set up a gradient with four different corner colors? I could imagine overloading the color property with something like active_color=gradient(<color_hex>,<color_hex>,<color_hex>,<color_hex>).

I will probably not work on this myself, but feel free to submit a PR.

mizlan commented 9 months ago

Woohoo, got it working. Gonna clean it up now

mizlan commented 9 months ago
Screenshot 2023-11-21 at 4 27 51 PM

Hehe

mizlan commented 9 months ago

4 different corner colors is interesting, it would be 4 different linear gradients in that case? Right now I just use one, that goes diagonally from one corner to the other, which is clipped.

FelixKratz commented 9 months ago

Looks really nice! Maybe we could just start with a two point gradient but already design the configuration to make it easily extensible for four point gradients. But we can think about the configuration some more once you submit the PR for the base functionality.

Bellavene commented 9 months ago

Agreed, two points would be enough for most cases. Nice idea.

Bellavene commented 9 months ago
Screenshot 2023-12-01 at 04 36 36

Nice! Thank you. How much it will eat resources, if possible altogether without much effort, if the gradient points will rotate or swap in dynamic? May even be just 5-10 frames of animation while window gets actived.

I believe it may look even more awesome if possible.

FelixKratz commented 9 months ago

Nice! Thank you. How much it will eat resources, if possible altogether without much effort, if the gradient points will rotate or swap in dynamic? May even be just 5-10 frames of animation while window gets active.

I dont think having an animation that plays the entire time is a good idea, as it would possibly drain the battery of mobile devices, however, short animations on window focus change would be something I could imagine being relatively easy on the battery. So yes, such a feature would be doable.

Bellavene commented 9 months ago

Awesome, hoping that someone will add it.