Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient messes with colors #374

Closed
GideonWolfe opened this issue Aug 8, 2020 · 3 comments
Closed

Gradient messes with colors #374

GideonWolfe opened this issue Aug 8, 2020 · 3 comments

Comments

@GideonWolfe
Copy link

GideonWolfe commented Aug 8, 2020

When/where was the bug introduced?

  • Are you using cava from a package repository, like AUR? Yes, AUR

Describe the bug
I am the original poster of issue #354, where all of a sudden cava refused to start unless I disabled the gradient in my configuration.

Now, I am able to start cava with a gradient, but it no longer uses colors from my terminal in the way that it so effortlessly did for many months previously.

image

Here you can see that the gradient is some random green color that is not present in my colorscheme. That is with urxvt. If I launch with alacritty the terminal colors for that session are permanently changed.

image

The left terminal shows the colors after I ran and closed cava with a gradient enabled.

To Reproduce
Steps to reproduce the behavior:

  1. Set config parameter to
[general]
framerate = 80

#█▓▒░ The number of bars (0-200). 0 sets it to auto (fill up console).
#█▓▒░ Bars' width and space between bars in number of characters.
bar_width = 1
bar_spacing = 1

[color]
gradient = 1
gradient_count = 4

[output]
#█▓▒░ Ouput method. Can be 'ncurses', 'noncurses' or 'raw'.
#█▓▒░ 'noncurses' is for systems that does not suport ncurses.
#█▓▒░ 'raw' is a 16 bit data stream of the bar heights that can be used to send to other applications.
#█▓▒░ 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
method = ncurses

#█▓▒░ Visual channels. Can be 'stereo' or 'mono'.
#█▓▒░ 'stereo' mirrors both channels with low frequencies in center.
#█▓▒░ 'mono' averages both channels and outputs left to right lowest to highest frequencies.
channels = mono

[smoothing]
#█▓▒░ Percentage value for integral smoothing. Takes values from 0 - 100.
#█▓▒░ Higher values means smoother, but less precise. 0 to disable.
integral = 85

#█▓▒░ Set gravity percentage for "drop off". Higher values means bars will drop faster.
#█▓▒░ Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off".
gravity = 100

  1. run

Expected behavior
cava sees my terminal colors and uses them in a gradient like it did for months previously

Screenshots
Above

Desktop (please complete the following information):

  • OS: 5.7.12-arch1-1 #1 SMP PREEMPT Fri, 31 Jul 2020 17:38:22 +0000 x86_64 GNU/Linux

Terminal emulator

  • urxvt v9.22
  • alacritty 0.5.0

Additional context
My configurations had been completely unchanged for a long time before this issue occurred, and the gradient has not worked properly since.

With the gradient disabled, cava has no trouble detecting my terminal colors and can cycle through them with f.

@karlstav
Copy link
Owner

karlstav commented Aug 9, 2020

the gradient has never been able to use the predefined colors in the terminal.

But I did change the default colors, so my guess is that the previous default values where closer to your system scheme then the current ones.

take a look at #181

the behavior when closing cava varies from system to system. some are able to reset back to the original scheme, some are not. I have not been able to work out why. But there is no way for ncurses to know the current color schemes, so there is unfortunately no good solution.

@GideonWolfe
Copy link
Author

But I did change the default colors, so my guess is that the previous default values where closer to your system scheme then the current ones.

I was replicating this with a friend and this is totally the case. The last gradient just happened to match my system perfectly!

My solution was to just create a cava config file as a pywal template.

[color]
gradient = 1
gradient_count = 4
gradient_color_1 = '{color1}'
gradient_color_2 = '{color2}'
gradient_color_3 = '{color4}'
gradient_color_4 = '{color5}'
gradient_color_5 = '{color6}'

This file with the correct colors filled in is stored at ~/.cache/wal/ where I just symlink it to ~/.config/cava/config Boom, perfect gradient.

@Dark-Kernel
Copy link

Can you please tell me how exactly you have done it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants