Jump to content

Limit the colors available in ColorPicker


arts
 Share

Go to solution Solved by iamtheky,

Recommended Posts

Hello,
 

I need to create a color picker with a limited and pre-defined number of colors to pick. Is it possible to do it with _GUIColorPicker_Create ?

Thank you.

 

Update: [sOLVED] with the ColorPicker UDF that allows to determine palette. Thank you.

Edited by arts
Link to comment
Share on other sites

  • Solution

you could probably make your own with labels fairly simply..  heres 5 minutes to make 3 color picker

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>


GuiCreate("3 color picker" , 320 , 100)

$LBL_red = GUICtrlCreateLabel("" , 0, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0xFF0000)

$LBL_green = GUICtrlCreateLabel("" , 110, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0x00FF00)

$LBL_blue = GUICtrlCreateLabel("" , 220, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0x0000FF)

guisetstate()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_PrimaryDown
            Case $LBL_blue
                msgbox(0, '' , "You Picked Blue")
            Case $LBL_green
                msgbox(0, '' , "You Picked Green")
            Case $LBL_red
                msgbox(0, '' , "You Picked Red")
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

 

you could probably make your own with labels fairly simply..  heres 5 minutes to make 3 color picker

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>


GuiCreate("3 color picker" , 320 , 100)

$LBL_red = GUICtrlCreateLabel("" , 0, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0xFF0000)

$LBL_green = GUICtrlCreateLabel("" , 110, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0x00FF00)

$LBL_blue = GUICtrlCreateLabel("" , 220, 0 , 100, 100)
GUICtrlSetBkColor(-1 , 0x0000FF)

guisetstate()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_PrimaryDown
            Case $LBL_blue
                msgbox(0, '' , "You Picked Blue")
            Case $LBL_green
                msgbox(0, '' , "You Picked Green")
            Case $LBL_red
                msgbox(0, '' , "You Picked Red")
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

Thank you very much. Anyway this doesn't use the _GUIColorPicker_Create and I am looking for a solution similar to the ColorPicker UDF but limited to a few colors. Any idea?

Link to comment
Share on other sites

 Anyway this doesn't use the _GUIColorPicker_Create and I am looking for a solution similar to the ColorPicker UDF

 

 

You are looking for a solution that utilizes _GuiColorPicker_Create in a solution similar to the ColorPicker UDF?  And that question is not in the least bit painful when you think about it? 

 

You want to use the UDF?  or you want to create your own?

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

You are looking for a solution that utilizes _GuiColorPicker_Create in a solution similar to the ColorPicker UDF?  And that question is not in the least bit painful when you think about it? 

 

You want to use the UDF?  or you want to create your own?

Ok, I mixed the _GUIColorPicker_Create function of the Color Picker Control UDF Library for AutoIt3 with the the Autoit3 function Choose_Color. I don't want to create any UDF. So, rephrasing, I want to know if there's a way of limiting the number of colors available in a color picker like the one displayed by the ColorPicker UDF but using the AutoIt3 function Choose_Color. Thanks.

 

Update: [sOLVED] with the ColorPicker UDF that allows to determine palette. Thank you.

Edited by arts
Link to comment
Share on other sites

Hello,

 

I need to create a color picker with a limited and pre-defined number of colors to pick. Is it possible to do it with _GUIColorPicker_Create ?

Thank you.

[sOLVED] with the ColorPicker UDF that allows to determine palette. Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...