Closed scorpium959 closed 2 years ago
You can!
Open ~/.config/glava/bars.glsl
and look for these lines:
/* Bar color changes with height */
#define GRADIENT (d / GRADIENT_POWER + 1)
/* Bar color */
#define COLOR (#3366b2 * GRADIENT)
Change them to something like this:
/* Bar color changes with height */
#define GRADIENT (d / AREA_HEIGHT)
/* Bar color */
#define LOW_COLOR #f542ff
#define HIGH_COLOR #33c2ff
#define COLOR mix(LOW_COLOR, HIGH_COLOR, GRADIENT)
mix
interpolates between the two colors. The 3rd parameter is a percentage (0.0 - 1.0), so I changed GRADIENT
to be a fraction of GLava's window height. You can adjust GRADIENT
to tweak how and where it transitions. Increasing/decreasing d
by some constant will shift the gradiant up and down, for example.
You can!
Open
~/.config/glava/bars.glsl
and look for these lines:/* Bar color changes with height */ #define GRADIENT (d / GRADIENT_POWER + 1) /* Bar color */ #define COLOR (#3366b2 * GRADIENT)
Change them to something like this:
/* Bar color changes with height */ #define GRADIENT (d / AREA_HEIGHT) /* Bar color */ #define LOW_COLOR #f542ff #define HIGH_COLOR #33c2ff #define COLOR mix(LOW_COLOR, HIGH_COLOR, GRADIENT)
mix
interpolates between the two colors. The 3rd parameter is a percentage (0.0 - 1.0), so I changedGRADIENT
to be a fraction of GLava's window height. You can adjustGRADIENT
to tweak how and where it transitions. Increasing/decreasingd
by some constant will shift the gradiant up and down, for example.
@JacksonWrath i dont know but the code doesnt work what i have to do? i copied the code but the result isnt like i wanted, the only color that is present is the low color but not the high.
Update, i got it work: `/ Bar color changes with height /
/ Bar color /
i had to change the AREA_HEIGHT constant to GRADIENT_POWER and it works now.
@JacksonWrath Thanks for the help :)
I'm glad you got something working! I think that happened because I forgot that I disabled the setgeometry
line in rc.glsl and am just enforcing the window size with KDE. The AREA_HEIGHT
might be different than what is actually being drawn or something.
Either way, you got the gist. You're welcome!
i changed the color of the bars, from that i had an idea, can i put 2 colors in the bar? Like: the part more taller have a color and it changes until reaching the base which will be purple maybe, the thing is to make a gradient transition between the 2 colors.