Random Colors from palette

Here everybody can post his problems with PhotoLine
Juan
Mitglied
Posts: 515
Joined: Thu 06 Oct 2011 08:08

Random Colors from palette

Post by Juan » Mon 25 Mar 2019 14:19

Hi all,

I have created my custom color palette over the Document Color List and a serie of vector objects inside a group. Now, what I would like to do is randomly apply specifically those colors from that palette to the objects inside the group.

This could be really helpful for archviz where we can show a "live" preview to customers on different colour options for facades for example if there is a random seed value.
Color.JPG
Cheers,
Juan
You do not have the required permissions to view the files attached to this post.

Martin Huber
Entwickler
Entwickler
Posts: 3451
Joined: Tue 19 Nov 2002 15:49

Re: Random Colors from palette

Post by Martin Huber » Mon 25 Mar 2019 17:59

Juan wrote:
Mon 25 Mar 2019 14:19
I have created my custom color palette over the Document Color List and a serie of vector objects inside a group. Now, what I would like to do is randomly apply specifically those colors from that palette to the objects inside the group.

This could be really helpful for archviz where we can show a "live" preview to customers on different colour options for facades for example if there is a random seed value.
The attached script should do this on Windows. Either execute it from Explorer or add it to "Filter > Scripts" by copying it to "%appdata%/PhotoLine/Automation" (create the "Automation" folder, if it doesn't exist yet).

You should use this script in combination with the latest beta version of PhotoLine (21.40B11), because scripting is constantly enhanced.

Martin
ApplyRandomColorsToGroup.vbs.zip
You do not have the required permissions to view the files attached to this post.

Juan
Mitglied
Posts: 515
Joined: Thu 06 Oct 2011 08:08

Re: Random Colors from palette

Post by Juan » Tue 26 Mar 2019 08:10

Martin Huber wrote:
Mon 25 Mar 2019 17:59
The attached script should do this on Windows. Either execute it from Explorer or add it to "Filter > Scripts" by copying it to "%appdata%/PhotoLine/Automation" (create the "Automation" folder, if it doesn't exist yet).

You should use this script in combination with the latest beta version of PhotoLine (21.40B11), because scripting is constantly enhanced.

Martin
ApplyRandomColorsToGroup.vbs.zip
It works perfect, thank you so much.

In script, can we make a popup window where I can have a button to regenerate the randomness, instead of calling the script every time?

Cheers,
Juan

Juan
Mitglied
Posts: 515
Joined: Thu 06 Oct 2011 08:08

Re: Random Colors from palette

Post by Juan » Tue 26 Mar 2019 15:14

I'm sorry to keep with asking about this, but would it be possible to add randomly only some selected colours from the Document list?
selected colors.jpg
Cheers,
Juan
You do not have the required permissions to view the files attached to this post.

Martin Huber
Entwickler
Entwickler
Posts: 3451
Joined: Tue 19 Nov 2002 15:49

Re: Random Colors from palette

Post by Martin Huber » Wed 27 Mar 2019 10:51

Juan wrote:
Tue 26 Mar 2019 08:10
In script, can we make a popup window where I can have a button to regenerate the randomness, instead of calling the script every time?
A script can't show non-modal dialogs. If you need to apply it often, you could assign a shortcut to the script.
Juan wrote:
Tue 26 Mar 2019 08:10
I'm sorry to keep with asking about this, but would it be possible to add randomly only some selected colours from the Document list?
A script can't query the selected colors, but it is possible to show an input dialog. The attached script does that. By entering "2 4" the colors from your example will be used.

Martin
ApplyColorsToGroupWithInput.vbs.zip
You do not have the required permissions to view the files attached to this post.

Juan
Mitglied
Posts: 515
Joined: Thu 06 Oct 2011 08:08

Re: Random Colors from palette

Post by Juan » Thu 28 Mar 2019 10:45

Martin Huber wrote:
Wed 27 Mar 2019 10:51
A script can't show non-modal dialogs. If you need to apply it often, you could assign a shortcut to the script.
That is a good suggestion, thanks.
Martin Huber wrote:
Wed 27 Mar 2019 10:51
A script can't query the selected colors, but it is possible to show an input dialog. The attached script does that. By entering "2 4" the colors from your example will be used.
Excellent, now it is perfect. I just wish I could know how to code, but my knowledge is bellow zero :oops:

Thank you again,
Juan