numixproject / numix-folders

Alternate folders for use with our base icon theme.
GNU General Public License v3.0
152 stars 26 forks source link

Changing to custom colors error #182

Open khaume opened 6 years ago

khaume commented 6 years ago

Downloaded latest version and used on Ubuntu 18.04. I got an error when trying to change to custom colors:

Traceback (most recent call last): File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 351, in colourbutton_changed self.colour[arg] = gdk_to_hex(colour) File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 33, in gdk_to_hex return "#" + "".join(["%02x" % (colour * 255) for colour in colours]) File "/home/khaume/Downloads/numix-folders-master/gui/gui", line 33, in <listcomp> return "#" + "".join(["%02x" % (colour * 255) for colour in colours]) TypeError: %x format: an integer is required, not float

I changed line 33 in gui/gui to cast the color to int, which solved it:

return "#" + "".join(["%02x" % int(colour * 255) for colour in colours])

abbluiz commented 5 years ago

Same here, using Qubes OS with Fedora 29 TemplateVM

palob commented 5 years ago

But you used it with the -t option, right?

abbluiz commented 5 years ago

Not really, I used it with the GUI. But calling the script from the terminal.

ghost commented 4 years ago

I'm still running into this bug now, I want to change the colours of the icons to match Adwaita

gamesbook commented 3 years ago

Same issue - full stack trace:

/home/derek/dev/github/numix-folders/gui/gui:129: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  self.win = Gtk.ApplicationWindow(Gtk.WindowType.TOPLEVEL, application=app)
/home/derek/dev/github/numix-folders/gui/gui:134: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.win.set_wmclass("numix-folders", "Numix Folders")
/home/derek/dev/github/numix-folders/gui/gui:214: DeprecationWarning: Gtk.ColorButton.set_color is deprecated
  self.colourbuttons[i].set_color(Gdk.color_parse(self.colour[i]))
/home/derek/dev/github/numix-folders/gui/gui:223: DeprecationWarning: Gtk.Widget.modify_font is deprecated
  self.colourentries[i].modify_font(Pango.FontDescription('monospace'))
/home/derek/dev/github/numix-folders/gui/gui:234: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  buttonok = Gtk.Button("_Apply", use_underline=True)
/home/derek/dev/github/numix-folders/gui/gui:236: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  buttonclose = Gtk.Button("_Cancel", use_underline=True)
/home/derek/dev/github/numix-folders/gui/gui:350: DeprecationWarning: Gtk.ColorButton.get_color is deprecated
  colour = widget.get_color()
Traceback (most recent call last):
  File "/home/derek/dev/github/numix-folders/gui/gui", line 351, in colourbutton_changed
    self.colour[arg] = gdk_to_hex(colour)
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in gdk_to_hex
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in <listcomp>
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
TypeError: %x format: an integer is required, not float
Traceback (most recent call last):
  File "/home/derek/dev/github/numix-folders/gui/gui", line 351, in colourbutton_changed
    self.colour[arg] = gdk_to_hex(colour)
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in gdk_to_hex
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
  File "/home/derek/dev/github/numix-folders/gui/gui", line 33, in <listcomp>
    return "#" + "".join(["%02x" % (colour * 255) for colour in colours])
TypeError: %x format: an integer is required, not float