weslly / ColorPicker

Color picker for Sublime Text
http://weslly.github.io/ColorPicker
511 stars 108 forks source link

Use external ColorPicker.dll in Windows #44

Closed pravic closed 10 years ago

pravic commented 10 years ago

Hi.

I made some changes to use an external Color Picker component due to standard one is too poor.

Code changes needs review concerning other platforms.

weslly commented 10 years ago

Thanks for the PR, I'll merge it as soon as I can test it :)

weslly commented 10 years ago

Do users need to download and install the external colorpicker app to make it work?

pravic commented 10 years ago

Nope. DLL in archive is self-contained, so we are free to use it.

weslly commented 10 years ago

I've contacted the app developer and he gave us permission to distribute the library with the plugin. Since the plugin is open source, I wanted to make sure we wouldn't have any copyright/dmca problems in the future. :smiley:

Which windows version(s) have you tested it with? I don't use Windows, so I'll have to setup some virtual machines to test it before merging.

pravic commented 10 years ago

I checked it at WinXP and Win7. idk about win8, but I can check if it is needed.

weslly commented 10 years ago

32 or 64 bits? I should have some time to test and merge it until tomorrow :)

pravic commented 10 years ago

WinXP x86 & Win7 x64. As for win8 — it is too ugly for me :D

weslly commented 10 years ago

Just tested it on Win-7 32 with both ST 2 and 3. It is definitely better than the default color picker! :D

For some reason, it isn't inserting the selected color. When I click "Ok", it always return "#000000". And if I open with a color selected, it also won't set it in the color picker. Any ideas?

pravic commented 10 years ago

Try C2 color instead of C1, which is background: http://clip2net.com/s/i5fPaV

weslly commented 10 years ago

Didn't find any major problem, so I'm merging this now. Thank you very much for the PR, and sorry for the delay :)

Tyree commented 10 years ago

I'm assuming you do not get the custom color picker when installing via Package Control. When I do, I still get the standard Windows color dialog. Do I have to download the zip and install manually? I installed it manually and I get this error: OSError: [WinError 193] %1 is not a valid Win32 application

pravic commented 10 years ago

I'm assuming you do not get the custom color picker when installing via Package Control.

why you think so?

Tyree commented 10 years ago

Why do I think what?

weslly commented 10 years ago

@Tyree what windows version are you using?

Tyree commented 10 years ago

Windows 7 x64 with ST3.

sseatwork commented 10 years ago

I got the same problem with Windows 7 x64 with ST2

Tyree commented 10 years ago

@stefBert , were you able to install via Package Control or did you have to install manually?

Here's the full log when trying to access Color Picker: Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublimeplugin.py", line 549, in run return self.run(edit) File "C:\Users\Matt Tyree\AppData\Roaming\Sublime Text 3\Packages\ColorPicker\sublimecp.py", line 172, in run color = self.pick_win(binpath, color) File "C:\Users\Matt Tyree\AppData\Roaming\Sublime Text 3\Packages\ColorPicker\sublimecp.py", line 240, in pick_win dll = ctypes.cdll.LoadLibrary(binpath) File "X/ctypes/init.py", line 431, in LoadLibrary File "X/ctypes/init.py", line 353, in init OSError: [WinError 193] %1 is not a valid Win32 application

pravic commented 10 years ago

ST3 x64 or x86? It seems, first. If yes, thats a problem, because DLL is x86.

Tyree commented 10 years ago

Yeah, my ST3 install is x64. I guess that's the difference. Dang.

sseatwork commented 10 years ago

@Tyree i installed it via Package Control. How could i access the log?

Tyree commented 10 years ago

Weird. I removed it and installed it via Package Control twice and still got the old version without the third party color picker. Installing manually fixed that, but then I got the error.

I guess we're calling it a x86 vs x64 issue, @weslly ?

weslly commented 10 years ago

I still didn't tag the last commit, so Package Control is still getting the old version. I had no problems with x86 but I can't tag the master branch while I don't fix x64. That would cause this problem for a lot of people.

weslly commented 10 years ago

Does anyone here knows C#? I found a smaller library, with the source code.

I compiled it using VS C# 2005 Express and it seems to work fine on both x86 and x32, but I have no idea how to make it work along with the plugin: http://www.codeproject.com/Articles/9959/Adobe-Color-Picker-Clone-part

pravic commented 10 years ago

So, since the VisualColorPicker.dll doesn't have an x64 bit version, we can use a proxy exe wrapper. It should work properly.

weslly commented 10 years ago

Sounds great. :) How can we do it?

sseatwork commented 10 years ago

I know a "little" about C#, i can take a look at that project. But i don't the requirements for the plugin.