It is currently Sat May 25, 2013 7:24 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 76 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: PasteColor
PostPosted: Tue Sep 04, 2012 4:16 pm 
Offline

Joined: Sat Jun 23, 2012 4:28 pm
Posts: 17
Moderator note: this thread is split from it's original posting:



---

tproli, i don't know is that what you realy need, but may be it help you - Colors MiniLab (leelusoft.blogspot.com)-potable and stealth, and Pipette (sttmedia.com/pipette)-port'n'stealth too. Or ColorMan (cgs.vdsworld.com)-port'n'(i hope)stealth.


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Tue Sep 04, 2012 8:02 pm 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
PasteColor
Color Copy Paste Tool for the Windows Color Picker

Attachment:
pastecolor-screenshot.png
pastecolor-screenshot.png [ 45.52 KiB | Viewed 470 times ]


PasteColor is a Windows color picker helper tool that helps you copy or paste color values easily.
Written in AutoIt.

More Information
Download

-----------------------------------------------

Thanks, but what I need is not a color picker. Many applications use the windows color picker and there is only a few solutions to replace it (e.g. http://www.joviancolorpicker.com/, but it's payware).

I can get a color by shift-clicking on a pixel in IrfanView. That puts the color in hex format in the clipboard. I would like to use this color data to quickly paste in the standard windows color picker (which has no option to input the hex color format).


Last edited by tproli on Tue May 07, 2013 1:12 pm, edited 5 times in total.

Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 7:20 am 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
Update: I had some time to play and PasteColor (wip name) is in alpha/beta version:

http://rolandtoth.hu/files/PasteColor.zip

I got an issue with StringRegExp, I cannot make [:xdigit:] work properly. I needed to ensure that clipboard contents has only hex values (0-9, a-f, A-F), and if it is not the case, show an error message.

Code:
Local $array = StringRegExp($color, '^[0-9a-fA-F]+$', 1)

If @error = 2 Then
    ShowError()
EndIf

If someone could look at it that would be great. The zip contains the source file, there you can see this in 46-50 (commented out).


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 7:55 am 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
AutoIt? I will have a look.

Edit: Is this what you are looking for >> http://www.autoitscript.com/forum/topic ... r-picking/

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 8:08 am 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
Sorry but why not use StringIsXDigit?

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 8:12 am 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
And here is the update to your SRE.

Code:
ConsoleWrite('Return: ' & _IsHexColor('FF00FF') & @CRLF)
ConsoleWrite('Return: ' & _IsHexColor('FF00HH') & @CRLF)

Func _IsHexColor($bColor) ; By guinness, Returns True or False.
   Return (StringRegExp($bColor, '[0-9a-fA-F]{6}', 0) = 1 And StringLen($bColor) = 6)
EndFunc   ;==>_IsHexColor

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 10:48 am 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
StringXDigit could have been useful if I had known about it :)

Finally I used this:
Code:
If StringRegExp($color, '\b[0-9a-fA-F]{6}\b', 0) = 0 Then
        ShowError()
    EndIf

The word boundaries ("\b") seems to eliminate the need of StringLen.

Thanks for your help!


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 11:11 am 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
I would say StringIsXDigit is a better option though. Oh, forgot about /b, SREs are tricky little things as you know, good thing they are universal in most programming languages, so you don't need to re-learn everytime.

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 12:39 pm 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
I wonder if something like this would be possible to do in AutoIt:

Image

That is, an "extension" to the standard Windows color picker, that has two options: copy current color (from the Red-Green-Blue input fields), and to paste color on clipboard (if any). This would require the application to run in the background and be shown only if the color picker is visible - this can be tricky because it is not a separate application. I tried to figure out a unique handler for the color picker but with no success, they were different in different applications. This doesn't mean there's no such thing though :)

I also wonder why aren't these features built-in to the OS.


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 12:48 pm 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
Why not have a look at _ChooseColor in the help file.

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 1:07 pm 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
I don't think you got it. There are applications that use the built-in windows color picker. There's no way to change it.

Think about customizing color in applications, e.g. the font color in Total Commander:

Image

In such cases you don't have an option to use a 3rd party picker.

Problem is when you need to input a specific color:

- it is not convenient to type 3 times up to 3 digit numbers to the R-G-B fields
- you have your color only in hex format: you cannot enter it
- you would like to copy a color that you just selected: no such feature, you have to memorize R-G-B digits

See this discussion:
http://superuser.com/questions/342921/i ... lor-picker


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 6:26 pm 
Offline
User avatar

Joined: Wed Apr 11, 2007 8:06 pm
Posts: 3477
Location: US, Texas
tproli wrote:
you would like to copy a color that you just selected: no such feature, you have to memorize R-G-B digits

The closest thing (and still quite far) I've seen is ArsClip form entry mode (paste item 1 {tab} paste item 2 {tab} paste item 3 and that would only work for a set number of colors that you prep in advance. I couldn't find anything on setting the default colors.

If you find something for this, I'm also interested. Would make some of the presentation work I do go a lot faster.

_________________
Supporting the Electronic Frontier Foundation | DuckDuckGo user | My GPG key | Projects donated to: VLC, CubicExplorer, Ditto, Greenshot, TrueCrypt


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Wed Sep 05, 2012 9:46 pm 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
Quote:
If you find something for this, I'm also interested.

The PasteColor I made does this. Currently supports hex color as input (e.g. #0099FF) and pastes the corresponding rgb values to the color picker. It could be easily modified to accept rgb as input (0,153,255).

The copy functionality would also be easy to add.

In this demo the clipboard has "#0099FF", then I moved the cursor to the "Red" input field and hit a hotkey (ctrl+shift+P), that launched PasteColor (I made a regular Windows shortcut and set this hotkey). PasteColor then converts the hex value to rgb and pastes in the fields (sends Red-TAB-Green-TAB-Blue just like ArsClip).

Image

So the functionality is practically ready but if I could make a panel that is visible each time the color picker pops up, that would simplify its usage (would be more user-friendly).


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Thu Sep 06, 2012 6:57 am 
Offline
User avatar

Joined: Sat Sep 09, 2006 10:14 am
Posts: 673
Location: Hungary
Here is an update:

http://rolandtoth.hu/files/PasteColor.zip

Usage
1. Assign a hotkey to PasteColor.exe (e.g. create a shortcut and set a hotkey)
2. Put the cursor in the "Red" field of the Windows color picker and invoke PasteColor's hotkey
3. In the pop-up input box enter the hex color value. You can use 3 or 6 digit value with or without the hash mark. The input box is pre-filled with clipboard data.

Changes
- added input box for hex color input: ability to enter custom hex color or cancel the process

I don't plan new features unless someone asks for them. Perhaps adding RGB input, that may come handy.


Top
 Profile  
 
 Post subject: Re: Portable Software that hasn't been developed?
PostPosted: Thu Sep 06, 2012 8:33 am 
Offline
User avatar

Joined: Mon Aug 27, 2007 2:00 am
Posts: 3740
I know I missed the mark on your problem, so I thought I would provide you with this function which might be of use to you.

Code:
ConsoleWrite('Return True: ' & _IsHexColor('FF00FF') & @CRLF)
ConsoleWrite('Return False: ' & _IsHexColor('FF00HH') & @CRLF)
ConsoleWrite('Return True: ' & _IsHexColor('0xFF00FF') & @CRLF)
ConsoleWrite('Return False: ' & _IsHexColor('0xFF00HH') & @CRLF)
ConsoleWrite('Return True: ' & _IsHexColor('#FF0000') & @CRLF)
ConsoleWrite('Return False: ' & _IsHexColor('#FF00J0') & @CRLF)

; Accepts the following formats:
; 0xFFFFFF
; FFFFFF
; #FFFFFF
Func _IsHexColor($bColor) ; By guinness, Returns True or False.
   Return StringRegExp($bColor, '\b(0x|#)?[0-9a-fA-F]{6}\b', 0) = 1
EndFunc   ;==>_IsHexColor

_________________
Added 177 Applications: Portable and an AutoIt MVP
SoftwareSpot - Portable Apps


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 76 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group