Old 05-24-2017, 12:26 AM   #1
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 422
Default LUA - Write Colors

Hi,
is there a way in LUA to write Windows custom color swatches (the ones bottom left in the attached picture).

It seems this is not possible, maybe it would be possible with the help of an external library somehow?

thanks


Gianfini is offline   Reply With Quote
Old 06-09-2017, 02:45 AM   #2
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 422
Default

Bump!

I think no answer = not possible... right?

g
Gianfini is offline   Reply With Quote
Old 06-09-2017, 03:32 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 6,556
Default

There is no function to bring up the operating system color chooser dialog.

You could write your own color chooser GUI from scratch, but it might get quite long winded to do.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 06-09-2017, 04:05 AM   #4
Pet
Human being with feelings
 
Pet's Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 863
Default

I'm not sure what you exactly are looking for, but to get that color code from the swatches, you can use the FREE pkColorPicker. This tool is great if you need to know details about the color you see somewhere on your monitor.

It gives you at least the color value in a decimal number, that is used by *.SWSColor Colorsets. Typing in the RGB-values gives you also the HTML, hex and dezimal values. Maybe it can be used in scripts too, I don't know.

There is also a thread about these REAPER color codes here: Thread: Color Codes.

HTH
__________________
If the v5 Default Theme is too bright for you take a gander at my mod of it: Default v5 Dark Theme
Pet is offline   Reply With Quote
Old 06-09-2017, 07:34 AM   #5
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 422
Default

Quote:
Originally Posted by Pet View Post
I'm not sure what you exactly are looking for, but to get that color code from the swatches, you can use the FREE pkColorPicker. This tool is great if you need to know details about the color you see somewhere on your monitor.

It gives you at least the color value in a decimal number, that is used by *.SWSColor Colorsets. Typing in the RGB-values gives you also the HTML, hex and dezimal values. Maybe it can be used in scripts too, I don't know.

There is also a thread about these REAPER color codes here: Thread: Color Codes.

HTH
Thank you Pet. I want to do exactly the contrary. I want to WRITE TO those color swatches, not get the color code. Rather I want to SET the color of those swatches, but couldn't find a way to do it.

thanks
g
Gianfini is offline   Reply With Quote
Old 06-09-2017, 07:47 AM   #6
Pet
Human being with feelings
 
Pet's Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 863
Default

Ha ha, as I said, "I'm not sure what you exactly are looking for... " but should have had in mind that when Xenakios says "NO" it is NO. Thought that if you get the color code you can do s.th. with it...sorry.
But maybe for you as a occasional themer it's...nah, forget it...
__________________
If the v5 Default Theme is too bright for you take a gander at my mod of it: Default v5 Dark Theme
Pet is offline   Reply With Quote
Old 06-09-2017, 08:42 AM   #7
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 6,556
Default

Quote:
Originally Posted by Pet View Post
Ha ha, as I said, "I'm not sure what you exactly are looking for... " but should have had in mind that when Xenakios says "NO" it is NO. Thought that if you get the color code you can do s.th. with it...sorry.
But maybe for you as a occasional themer it's...nah, forget it...
Actually I am not completely sure what the original poster was even asking for...
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 06-12-2017, 12:42 AM   #8
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 422
Default

Quote:
Originally Posted by Xenakios View Post
Actually I am not completely sure what the original poster was even asking for...
Ok, then my english is definitely bad.. Last try: I want to change the Windows custom colors within the script. E.g. assign a specific color to the 16 custom colors (see my first post picture) by code.

Use case: I have a script that defines a set of colors, and I would like to save them into the Windows custom color swatches.

Hope is clearer now, but anyway I understand this is not possible...

g
Gianfini is offline   Reply With Quote
Old 06-12-2017, 03:13 AM   #9
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 4,099
Default

It's not possible. At least I don't think so. And in any case, it would be different for OSX, or Linux. Complicated.
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
Old 06-12-2017, 04:13 AM   #10
Pet
Human being with feelings
 
Pet's Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 863
Default

This time I shut up...

But if I would not, I would mention that there must be s.th. like this going on when you load a SWSColorset. That maybe could be transformed to lua...but...hm...
__________________
If the v5 Default Theme is too bright for you take a gander at my mod of it: Default v5 Dark Theme
Pet is offline   Reply With Quote
Old 06-12-2017, 08:48 AM   #11
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 4,209
Default

Quote:
Originally Posted by Xenakios View Post
There is no function to bring up the operating system color chooser dialog.

You could write your own color chooser GUI from scratch, but it might get quite long winded to do.
retval, colorOut = reaper.GR_SelectColor()

But no, there's no way to rewrite the "preset" colors from ReaScript.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.