ChooseColors() : Color selection UI

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: ChooseColors() : Color selection UI

Post by SKAN » 01 Jul 2021, 18:07

@fabricio234

Please stop polluting this entire topic with your images.
You could atleast use spoler tag ?!!

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: ChooseColors() : Color selection UI

Post by SKAN » 01 Jul 2021, 18:11

lblb wrote:
01 Jul 2021, 18:03
@fabricio234

Are you using multiple monitors of either different dpi or Windows magnification? I get the same "black" issue when I do.
Really?
Runs fine in my primary which is 100% scaling.
Mouse position is incorrect in my secondary monitor which runs at 150% scaling.
But no black issues for me!!

fabricio234
Posts: 122
Joined: 06 Mar 2020, 21:48

Re: ChooseColors() : Color selection UI

Post by fabricio234 » 01 Jul 2021, 18:22

Im using a laptop connected to a monitor, but only the monitor is on
The scale is at 150%

fabricio234
Posts: 122
Joined: 06 Mar 2020, 21:48

Re: ChooseColors() : Color selection UI

Post by fabricio234 » 01 Jul 2021, 19:04

@SKAN i figured out why the GUI was moving, i have pasted the script in a file i already was using and i did not clear the header of the file and it had a OnMessage(0x0201, "WM_LBUTTONDOWN") there :facepalm:
Now I'm testing I'm a clean file, it working good not moving anymore and the click/select color is working perfectly, I'm really sorry for my mistake.

May i ask, how do i set the Gradient selector in horizontal?

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: ChooseColors() : Color selection UI

Post by SKAN » 01 Jul 2021, 19:20

fabricio234 wrote:
01 Jul 2021, 19:04
May i ask, how do i set the Gradient selector in horizontal?
It is already horizontal? You mean vertical? You mean you want to alter my UI?
It cannot be done without a massive rewrite.
The Gradient, the Hue selector below it and History colors are all tied to same GoSub function ChooseColors_HueSelect().
The mouse has to move horizontally.
Also it will be hard to recalculate everything to support DPI scaling. I can't do it all over again.

lblb
Posts: 190
Joined: 30 Sep 2013, 11:31

Re: ChooseColors() : Color selection UI

Post by lblb » 02 Jul 2021, 15:40

@SKAN

In my work setup, I have three monitors (1920 x 1080, 1280 x 1024, 2560 x 1704) and the "black" issue only occurs on the third one, which is the only one that has a Windows magnification of 200% (the two others are at 100%).

I don't think you need to recalculate everything to support DPI scaling. Adding something like

Code: Select all

DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
at the top of the script solved the issue for me. See some relevant info about that here:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=90374
https://www.autohotkey.com/boards/viewtopic.php?p=243128#p243128

kauan014
Posts: 55
Joined: 18 Feb 2021, 20:03

Re: ChooseColors() : Color selection UI

Post by kauan014 » 02 Jul 2021, 21:25

SKAN is possible to enable the "hand icon" whenever you move the mouse over the scrollable area like the gradient and not only when you click hold?

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: ChooseColors() : Color selection UI

Post by SKAN » 04 Jul 2021, 14:33

@lblb
I'll check that out. Thanks.
 
kauan014 wrote:
02 Jul 2021, 21:25
SKAN is possible to enable the "hand icon" whenever you move the mouse over the scrollable area like the gradient and not only when you click hold?
Not hard to implement but that would require sub-classing the GUI.
Please remember that this is a function and meant to be called from main scripts.
I wouldn't want a subclass routine to clash with any other GUI that might co-exist.

I will implement this as a trial, but I will remove it if it makes my always-running-script unstable. :thumbup:
While at it I'm also implementing context menus for Gradient, New color and History.
Using GuiOptions, we may pass grouped colors (palette) in INI file format.
 
Here is a preview:
Spoiler

ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: ChooseColors() : Color selection UI

Post by ozzii » 05 Jul 2021, 08:02

Thank you SKAN for your work

kauan014
Posts: 55
Joined: 18 Feb 2021, 20:03

Re: ChooseColors() : Color selection UI

Post by kauan014 » 06 Jul 2021, 20:05

SKAN any news regarding the "hand icon" thing?

User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: ChooseColors() : Color selection UI

Post by SKAN » 08 Jul 2021, 16:08

July 9 2021: App updated to v0.96 from v0.64
July 20 2021: App updated to v0.97 from v0.96

jly
Posts: 89
Joined: 30 Sep 2020, 06:06

Re: ChooseColors() : Color selection UI

Post by jly » 11 Mar 2022, 04:23

Hi SKAN:


When I use screen capture mode, click either static icons and The screen can be captured, but the mouse disappears
Is it designed this way, or is there something wrong with my computer?


Versions:

ChooseColors.ahk:
v0.97

AhkVersion
1.1.33.08

OS:
Microsoft Windows 10 Professional Edition
10.0.19044

Desktop

Chappier
Posts: 44
Joined: 21 Aug 2021, 21:58

Re: ChooseColors() : Color selection UI

Post by Chappier » 11 Mar 2022, 16:53

Great job SKAN!

When i click multiple times in a color it goes getting darker, is possible to disable this behaviour?

N_athan
Posts: 40
Joined: 21 Aug 2021, 16:40

Re: ChooseColors() : Color selection UI

Post by N_athan » 13 Mar 2022, 08:42

How to increase the width of the colors in the history? i mean these above the buttons cancel/ok.
I tried changing the first value in this function:

Code: Select all

ChooseColors_HistorySetBitmap(Glob) {
Local
    Hbm := Glob.Func.CreateBitmap.Call(25, 1, 0, 32)
    VarSetCapacity(BMBITS, 100, 0),   n := pBits := &BMBITS+100,   i := Ok := 0

    Loop, Parse, % Glob.Que, |
        pBits := Numput("0x" . A_LoopField, pBits-4, "UInt") - 4,   i := Ok := A_Index
    Loop % ( 25-i )
        pBits := Numput(0xFFFFFF, pBits-4, "UInt") - 4

    DllCall("Gdi32.dll\SetBitmapBits", "Ptr",Hbm, "Int",100, "Ptr",&BMBITS)
    Glob.Func.SetImage.Call(Glob.History.Hwnd, Hbm, True)
}

Specially Hbm := Glob.Func.CreateBitmap.Call(25, but the width remains the same.


@Chappier i also noted this, each time i click on a color it goes getting darker, i dont know if its a desired behaviour, but would be nice being possible to disable.
Spoiler

SoraHjort
Posts: 8
Joined: 13 Sep 2017, 17:31

Re: ChooseColors() : Color selection UI

Post by SoraHjort » 18 Aug 2022, 01:45

It really does look lovely. However I've been running into an issue. When selecting a color, the only way for the color to be returned is by first adding it to the list. I'm not seeing how to simply click "OK" for it to use the currently selected colorafter selecting it on graph, it'll always return the all or a specific entry in the saved list of colors instead.

Having to require the added step of "right click and add the color" would sadly not work with the project I'm building. But having it so people can just paste in the hexcode or selecting it on the graph without that extra step would be ideal.

Is there something I'm not quite catching?

Post Reply

Return to “Scripts and Functions (v1)”