Comments (28)
Same issue here
from colorpicker.
Same issue here… although it stopped working at all (even outside selections) a few hours after installing.
De-install / re-install does not fix the issue.
Nothing appearing in the console.
Ubuntu - sublime build 3059
from colorpicker.
The problem is in "lib/linux_colorpicker.py", it crashes with the message:
Exception:"'gi.repository.Gtk' object has no attribute 'gdk'"
Unfortunately, I dont know anything about Gtk and could not find a solution when banging my head on the keyboard.
(I had python logging to a file so I could see the Exception, as Ornthalas said nothing appears in the console)
from colorpicker.
Well, I've at least found a working solution, but I am not sure if it breaks compatibility with older versions of pyGtk / Linux:
#!/usr/bin/env python
from gi.repository import Gtk
from gi.repository import Gdk
import sys
color_sel = Gtk.ColorSelectionDialog("Sublime Color Picker")
if len(sys.argv) > 1:
if Gdk.color_parse(sys.argv[1]):
color_sel.get_color_selection().set_current_color(Gdk.color_parse(sys.argv[1]))
if color_sel.run() == Gtk.ResponseType.OK:
color = color_sel.get_color_selection().get_current_color()
#Convert to 8bit channels
red = int(color.red / 256)
green = int(color.green / 256)
blue = int(color.blue / 256)
#Format
finalcolor = "%02x%02x%02x" % (red, green, blue)
print (finalcolor.upper())
color_sel.destroy()
Changes made:
Gtk.gdk to from gi.repository import Gdk
colorsel to get_color_selection()
Gtk.gdk.Color() to Gdk.color_parse()
from colorpicker.
Works for me. Thanks.
from colorpicker.
It should not be too difficult to catch exceptions to switch to one or the other version depending on the version of Gtk...any plans to update this @weslly ?
from colorpicker.
Same issue for me - it's not working with keyboard shortcut nor with the command. I'm on Linux Ubuntu, Sublime 3. No message in console.
from colorpicker.
Ubuntu 14.04 x64 here with ST3. The fix works perfectly for me, love it!
from colorpicker.
Worked here
ubuntu 13.10 st3 3059
from colorpicker.
Fix by @CaiusCaligulaCC worked for me.
Ubuntu 14.04 32bits, st3 3059
from colorpicker.
Thank you for the fix.
Mint 17 x64, ST3
from colorpicker.
Had problems on Ubuntu 14.04 / ST3, made a fix and was going to post it here, to find out that other people already have solved it, shame on me for not using google first, anyways here is my fix:
(~/.config/sublime-text-3/Packages/User/ColorPicker/bin/linux_colorpicker.py)
#!/usr/bin/env python
import gtk
import sys
color_sel = gtk.ColorSelectionDialog("Sublime Color Picker")
if len(sys.argv) > 1:
if gtk.gdk.Color(sys.argv[1]):
color_sel.colorsel.set_current_color(gtk.gdk.Color(sys.argv[1]))
if color_sel.run() == gtk.RESPONSE_OK:
color = color_sel.get_color_selection().get_current_color()
#Convert to 8bit channels
red = int(color.red / 256)
green = int(color.green / 256)
blue = int(color.blue / 256)
#Format
finalcolor = "%02x%02x%02x" % (red, green, blue)
print (finalcolor.upper())
color_sel.destroy()
to test, run this on the console:
python ~/.config/sublime-text-3/Packages/User/ColorPicker/bin/linux_colorpicker.py #ff0000
changes made:
- rename Gtk -> gtk
- removed the gi.repository (not sure if this is correct, but I got errors with that statement in the include)
- used
gtk.RESPONSE_OK
instead ofgtk.ResponseType.OK
Hope it might help anyone
from colorpicker.
@vespakoen I applied your changes, but I get this error when running the command in ST3's console.
>>> python ~/.config/sublime-text-3/Packages/User/ColorPicker/bin/linux_colorpicker.py #ff0000
File "<string>", line 1
python ~/.config/sublime-text-3/Packages/User/ColorPicker/bin/linux_colorpicker.py #ff0000
^
SyntaxError: invalid syntax
And the plugin doesn't work at all :/
EDIT: Nevermind. Changing this line to #!/usr/bin/env python2
fixed it
from colorpicker.
I have a working version that maintains compatibility with the older versions, can you guys test it?
from colorpicker.
LinuCC's fix worked for me on ST2 (Xubuntu 14.04)
from colorpicker.
@eyalzek can you test my version? It maintains backwards compatibility. So we can have a merge in the near future. Thank you!
from colorpicker.
@mstrcnvs it seems to be working fine
from colorpicker.
I've been using VIM for the last few months but I came back to sublime this week. I'll take a look at the issue(s) and merge the fixes as soon as possible (probably this week or so). Sorry for the waiting.
from colorpicker.
Cheers @weslly!
from colorpicker.
ubuntu 14.10 x64 plugin dont start if cursor placed on any color code, but if cusor don't point on color the plugin starts good. For some reasons it can't pick color from sublime. On ST2(2221) and ST3(3065) result the same.
from colorpicker.
Wanted to confirm this behaviour "ubuntu 14.10 x64 plugin dont start if cursor placed on any color code, but if cusor don't point on color the plugin starts good. For some reasons it can't pick color from sublime. On ST2(2221) and ST3(3065) result the same." on 14.04.1
from colorpicker.
@slavugan @markandrewj Hi guys, can you test my working version? So that we can get a merge? It should work with cursor placed on a color code.
from colorpicker.
@mstrcnvs Where can I take your working version for test?
from colorpicker.
@slavugan http://github.com/mstrcnvs/ColorPicker
from colorpicker.
@mstrcnvs it works good, so you can merge ))
from colorpicker.
You guys rock!
from colorpicker.
The fix was merged and released.
from colorpicker.
sorry I didn't have a moment to test, glad the bug has been closed, ty for patching
from colorpicker.
Related Issues (20)
- Does not work, an error pops up when running Color Picker HOT 1
- Removed the plugin because it crashes Sublime! HOT 1
- Color picker doesn't open inside Sublime on Mac HOT 2
- Not working on Kubuntu 20.04 HOT 3
- Not working when color code selected [Arch Linux] HOT 1
- Color picker not working in css file
- how to add scanning for .less files?
- how to make HSL sliders the default instead of RGB?
- Color picker does not open when hovering over a color in css file HOT 1
- Object "app" not being used/called
- Currently unavailable in Package Control HOT 2
- Updated package with PRs included
- eyedropper?
- Not opening neither using 'Ctrl+Shift+C' nor 'Tools --> Color Picker' - Ubuntu 22.04 HOT 3
- SBT3 'ColorPicker" doesn't export my color choice in RGB but always in HEX...
- Color Picker not working Ubuntu 18.04 HOT 7
- Feature Request: Add prefix settings HOT 1
- New windows colorpicker returning #CANCEL HOT 1
- New windows colorpicker can't edit colors HOT 7
- Color Picker doesn't show up anymore HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorpicker.