Gremious / discord-wal-theme-template

Pywal and Wallust template files for generating Vencord themes.
7 stars 1 forks source link

AttributeError: 'Color' object has no attribute 'red' #2

Closed TheRedstoneRadiant closed 6 months ago

TheRedstoneRadiant commented 6 months ago

Hey! I'm trying to use this theme, but after copying discord-wal.css to $HOME/.config/wal/templates and running pywal, I get the following error:

> wal -i X39qMYI.jpeg
[I] image: Using image X39qMYI.jpeg.
[I] theme: Set theme to _home_user_Wallpapers_X39qMYI_jpeg_dark_None_None_1.1.0.json.
[I] colors: Found cached colorscheme.
[I] wallpaper: Set the new wallpaper.
[I] sequences: Set terminal colors.

Traceback (most recent call last):
  File "/usr/bin/wal", line 33, in <module>
    sys.exit(load_entry_point('pywal==3.3.0', 'console_scripts', 'wal')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pywal/__main__.py", line 208, in main
    parse_args(parser)
  File "/usr/lib/python3.11/site-packages/pywal/__main__.py", line 185, in parse_args
    export.every(colors_plain)
  File "/usr/lib/python3.11/site-packages/pywal/export.py", line 68, in every
    template(colors, file.path, join(output_dir, file.name))
  File "/usr/lib/python3.11/site-packages/pywal/export.py", line 15, in template
    template_data = "".join(template_data).format(**colors)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Color' object has no attribute 'red'

~/Wallpapers                                                                                                         
> wal -v
wal 3.3.0

When running with the wal backend, I get a different error message:

> wal -i X39qMYI.jpeg -b wal
[I] image: Using image X39qMYI.jpeg.
[I] theme: Set theme to _home_user_Wallpapers_X39qMYI_jpeg_dark_None_None_1.1.0.json.
[I] colors: Found cached colorscheme.
[I] wallpaper: Set the new wallpaper.
[I] sequences: Set terminal colors.

Traceback (most recent call last):
  File "/usr/bin/wal", line 33, in <module>
    sys.exit(load_entry_point('pywal==3.3.0', 'console_scripts', 'wal')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pywal/__main__.py", line 208, in main
    parse_args(parser)
  File "/usr/lib/python3.11/site-packages/pywal/__main__.py", line 185, in parse_args
    export.every(colors_plain)
  File "/usr/lib/python3.11/site-packages/pywal/export.py", line 68, in every
    template(colors, file.path, join(output_dir, file.name))
  File "/usr/lib/python3.11/site-packages/pywal/export.py", line 15, in template
    template_data = "".join(template_data).format(**colors)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pywal/util.py", line 25, in rgb
    return "%s,%s,%s" % (*hex_to_rgb(self.hex_color),)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pywal/util.py", line 116, in hex_to_rgb
    return tuple(bytes.fromhex(color.strip("#")))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: non-hexadecimal number found in fromhex() arg at position 0

pywal installed via AUR (extra/python-pywal, version 3.3.0-8).

Please let me know if you need any more information. Thanks.

Gremious commented 6 months ago

So, apparently, the official current 3.3.0 pywal release doesn't support .color modifiers. I did a manual git install and that did work.

So, solution there is ether install 3.3.1 from latest git directly, or use wallust instead of pywal.


As for the wal backend breaking:

The backend issue is ...drum roll... pilot error. This is the error you get when you use -b instead of --backend.

https://github.com/dylanaraps/pywal/issues/358#issuecomment-633134351