|
|
|
03-10-2020, 04:47 PM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
amagalma_Adjust theme colors script
https://stash.reaper.fm/38676/amagal...rs%20v2.00.gif
# Adjusts the colors of ANY theme in groups
- Theme supports both zipped and unzipped themes
- Offers Brightness, Contrast and Gamma adjustments
- A/B Button to toggle between the current setting and the original theme colors
- Use the Take Snapshot button to store settings and make new adjustments on these rather than the original theme's colors
- The Snapshots are the base colors on which you make adjustments using the sliders
- The adjustments are applied to the selected color groups in the Color Groups Tab. The rest of the theme colors are copied over
- In the Color Groups Tab you can inspect or change the theme colors on which the adjustments apply
- In the Listbox you can choose (click) or delete (Alt-click) your saved Snapshots
- If you change the Color Groups selection a Snapshot is automatically taken
- UNDO/REDO buttons to undo/redo adjustments made on the selected theme color Snapshot in the Listbox
- User is prompted to save when exiting and if there were color changes in comparison to the original theme
- If user changes theme while the script is running, script automatically closes and prompts user to save if there were any changes
- The new saved adjusted theme inherits the old theme's "Default_6.0 theme adjuster" settings, if any
- Script Requires Lokasenna GUI v2 and JS_ReaScriptAPI to work. Both are checked if they exist at the start of the script
available in ReaPack!
v2.08 changelog:
- Windows now uses 7za.exe for the extraction (older OS like XP are now supported)
-- -- -- --
v2.07 changelog:
- Improved extraction method for Windows (no cmd window pops up)
-- -- -- --
v2.06 changelog:
- Changed extraction method for Windows (now works for Reaper x86 too)
-- -- -- --
v2.05 changelog:
- Left-click to Add a Snapshot, Right-click to Replace current Snapshot.
- Improved some tooltips and the logic of when to create automatically a new Snapshot when the user changes Color Group selection
-- -- -- --
v2.00 changelog:
- Complete re-design. See above how it works now.
-- -- -- --
v1.42 changelog:
- The extraction code should now work in OSX/Linux too (thanks cfillion again!)
-- -- -- --
v1.41 changelog:
- Fixed crashing while saving unzipped files (introduced in 1.40)
-- -- -- --
v1.40 changelog:
- Fixed bug with messed up recall of last undo setting when having deleted a previous one
- Now when moving the sliders, the new setting is automatically applied
- Mousewheel always adjusts by 1 (fine tunning) and needs a click on the slider to apply setting
- Changed slider behavior: clicking on the slider does not move the handle any more, but now it applies the setting - same as clicking on the Apply Settings button (useful after mousewheel)
-- -- -- --
v1.35 changelog:
- Zipped themes support (ReaperThemeZip)
- The new saved adjusted theme inherits the old theme's "Default_6.0 theme adjuster" settings, if any
-- -- -- --
v1.27 changelog:
- Various optimizations and improvements of the A/B mode
- Bug fixes of some corner cases
-- -- -- --
v1.25 changelog:
- Rearranged order of appearance of previous settings to coincide with sliders' order
- Fixed adjusted theme not saving if saved under the name of an existing theme file
- Fixed OSX and Linux crashing
-- -- -- --
v1.2 changelog:
- Listbox where previous settings can be chosen and inspected (instead of Undo and Redo buttons)
- Alt-Click Listbox item to remove it
- Added A/B button that toggles between current setting and original theme colors
- Increased range of sliders and reordered them for better results (Brightness & Contrast -> Gamma)
---------------------------
(original post)
https://stash.reaper.fm/38520/Adjust...e%20colors.gif
I am making a script that adjusts the colors of any theme. To finish it, I need the formula for colors that can be blended:
https://stash.reaper.fm/38521/theme%20blend.jpg
Does anyone know this? How can I go from a number to r,g,b,a and blend mode? Furthemore, how can I calculate the visible color of two blended colors? (for example grid lines, over arrange background color)
Thanks!
Last edited by amagalma; 04-01-2020 at 03:39 PM.
|
|
|
03-10-2020, 05:49 PM
|
#2
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Woah, what a great script, thanks!
|
|
|
03-10-2020, 06:55 PM
|
#3
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Very promising !
Blend mode are quite standard operation, with Alpha as final multiplicator.
Look at formulas there for eg : https://photoblogstop.com/photoshop/...odes-explained
|
|
|
03-10-2020, 07:28 PM
|
#4
|
Human being with feelings
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,827
|
Very nice
|
|
|
03-10-2020, 07:44 PM
|
#5
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Cool!
I'm thinking if the changes were applied immediately when moving the sliders (and have a Revert button instead) may be even nicer.
|
|
|
03-10-2020, 08:24 PM
|
#6
|
Human being with feelings
Join Date: Dec 2017
Posts: 179
|
Excited about this!
|
|
|
03-11-2020, 04:08 AM
|
#7
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Thanks guys!
Quote:
Originally Posted by X-Raym
|
Thanks for the link! The blend modes that are available in Reaper are: Normal, Add, Overlay, Multiply, Dodge and HSV adjust. The formulas may be of help to determine the resulting color, although the start of the article is a little bit discouraging ("Working with blend modes is almost always an experimental process. Because it’s nearly impossible to predict the results")
Still, we need a formula that translates the integer of a color to its components. For normal colors there are:
Code:
r, g, b = reaper.ColorFromNative( col )
col = reaper.ColorToNative( r, g, b )
But for example, let's take the color of the Play cursor.
Code:
playcursor_color = 0 (white - r,g,b = 256,256,256)
playcursor_drawmode = 131072 (normal 1.00)
If I change the fill mode to Normal 0.5 then the values are:
Code:
playcursor_color = 255
playcursor_drawmode = 196608
We need the formula that will translate the integer of the drawmode to the mode and value and then the formula that relates this blend to the affected color (in this case playcursor_color).
And then we need the maths (your link may help) that will relate these values to the values of the base color so that we know the resulting visible color.
Quote:
Originally Posted by nofish
Cool!
I'm thinking if the changes were applied immediately when moving the sliders (and have a Revert button instead) may be even nicer.
|
That is what I wanted to do, but I don't think it will work, because loading a theme is not immediate - not fast enough. The way it works is by making a copy of the theme and writing the changed values to the copy (the original theme is left untouched), then loading the adjusted theme when one hits apply. I can certainly add an undo (and redo) button, though, that will revert to the previous values and previous adjusted state.
|
|
|
03-11-2020, 04:08 AM
|
#8
|
Human being with feelings
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 546
|
Great job!
|
|
|
03-11-2020, 04:44 AM
|
#9
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by amagalma
That is what I wanted to do, but I don't think it will work, because loading a theme is not immediate - not fast enough. The way it works is by making a copy of the theme and writing the changed values to the copy (the original theme is left untouched), then loading the adjusted theme when one hits apply. I can certainly add an undo (and redo) button, though, that will revert to the previous values and previous adjusted state.
|
Oh I wasn't aware the script is that involved, makes sense.
Thanks.
|
|
|
03-11-2020, 05:12 AM
|
#10
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,902
|
Quote:
"Working with blend modes is almost always an experimental process. Because it’s nearly impossible to predict the results")
|
Oh don't worry, this is from a creative graphical manipulation/illustration context (aka, when you are making a digital paiting or a digital photo manipulation), in the math field there is no randomness involved :P
Quote:
playcursor_drawmode = 196608
|
This looks like you have to do some reverse engineering as it is reaper specific. Set normal to 0, normal to 1, Add to 0, Add to etc... You may find the formulas from the reslting data
|
|
|
03-11-2020, 05:19 AM
|
#11
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by X-Raym
This looks like you have to do some reverse engineering as it is reaper specific. Set normal to 0, normal to 1, Add to 0, Add to etc... You may find the formulas from the reslting data
|
I think I will need the help of the greatest reverse engineer around here... ( mespotine )
|
|
|
03-11-2020, 06:21 AM
|
#12
|
Human being with feelings
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
|
This is super cool! Thanks!
|
|
|
03-11-2020, 01:12 PM
|
#13
|
Human being with feelings
Join Date: Aug 2019
Location: beijing
Posts: 612
|
Wow this is a very handy feature..
Lookin forward to this !
|
|
|
03-11-2020, 02:19 PM
|
#14
|
Human being with feelings
Join Date: Jul 2013
Location: Portugal
Posts: 1,827
|
That's a smart move towards a next great feature. Thanks.
|
|
|
03-11-2020, 03:12 PM
|
#15
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Script is on ReaPack
|
|
|
03-12-2020, 09:55 AM
|
#16
|
Human being with feelings
Join Date: Mar 2019
Posts: 885
|
super nice feature here!
I just ran the ‘atc’-script and successfully managed to adjust the backgrounds/save as new. I understand this does not work on gfx elements. This was on Win10 r1909
Also tried on macOS10.14.6, and got the following error:
amagalma_Adjust theme colors.lua:137: attempt to concatenate a nil value (upvalue 'path')
Is there something I should do to make it work on mac?
.
|
|
|
03-12-2020, 10:48 AM
|
#17
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
couldn't see this script on reapack
edit: found it after sync.
Last edited by Reflected; 03-12-2020 at 10:59 AM.
|
|
|
03-12-2020, 01:44 PM
|
#18
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by PhelixK
super nice feature here!
I just ran the ‘atc’-script and successfully managed to adjust the backgrounds/save as new. I understand this does not work on gfx elements. This was on Win10 r1909
Also tried on macOS10.14.6, and got the following error:
amagalma_Adjust theme colors.lua:137: attempt to concatenate a nil value (upvalue 'path')
Is there something I should do to make it work on mac?
.
|
Shit! I forgot Mac and Linux use different path system.. I' ll fix this!
I have just uploaded the new improved version of the script (v1.2). I'll fix the Mac/Linux thing and upload v1.21 later.
|
|
|
03-12-2020, 03:01 PM
|
#19
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
New version up in Reapack in a few moments.
changelog v1.25
Fixed order of appearance of previous settings to coincide with sliders' order
Fixed adjusted theme not saving if saved under the name of an existing theme file
Fixed OSX and Linux crashing
|
|
|
03-12-2020, 03:17 PM
|
#20
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
BTW
is it possible to make a script which copy selected colors from 1 theme to another ?
|
|
|
03-12-2020, 04:17 PM
|
#21
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by Reflected
BTW
is it possible to make a script which copy selected colors from 1 theme to another ?
|
It could be done but the most difficult part would be the color selection.. There are about 350 colors in a theme.. How would one select what gets copied?
|
|
|
03-13-2020, 01:42 AM
|
#22
|
Human being with feelings
Join Date: Jan 2020
Location: quebec CA
Posts: 1,576
|
is there a video that explain the steps i need to do,cuz
i dont understand nothing at all....
__________________
[cpu=i7-6700,12gig ram]DAW=Reaper-[roland-quad-capture]-[krk rokit-5 G3]-[TR5-eq 81]-
[amplitube-max]
YouTube: ricky & marty
|
|
|
03-13-2020, 02:56 AM
|
#23
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by martmix
is there a video that explain the steps i need to do,cuz
i dont understand nothing at all....
|
No, because it is very easy.
1) Do you know how to load scripts?
2) Have you got ReaPack?
3) Do you know how to extract the ReaperTheme from a ReaperThemeZip?
Which part confuses you?
|
|
|
03-13-2020, 03:10 AM
|
#24
|
Human being with feelings
Join Date: Jan 2020
Location: quebec CA
Posts: 1,576
|
Quote:
Originally Posted by amagalma
No, because it is very easy.
1) Do you know how to load scripts?
2) Have you got ReaPack?
3) Do you know how to extract the ReaperTheme from a ReaperThemeZip?
Which part confuses you?
|
thank you amagalma i got it to work
__________________
[cpu=i7-6700,12gig ram]DAW=Reaper-[roland-quad-capture]-[krk rokit-5 G3]-[TR5-eq 81]-
[amplitube-max]
YouTube: ricky & marty
|
|
|
03-13-2020, 08:29 AM
|
#25
|
Human being with feelings
Join Date: Mar 2019
Posts: 885
|
Quote:
Originally Posted by amagalma
New version up in Reapack in a few moments.
changelog v1.25
Fixed order of appearance of previous settings to coincide with sliders' order
Fixed adjusted theme not saving if saved under the name of an existing theme file
Fixed OSX and Linux crashing
|
Hi, perfect! -works fine on mac now.
A question regarding extended features in v6,
When using the color script on themes that are compatible with the Theme Adjuster in v6, I notice the script instantly resets all TA settings to default by creating a temporary entry called [adjusted__. This is of course to be expected due to the presence of a new theme file in the reaper-themeconfig.ini.
Then, when we decide to save as a new theme, I wonder if it would be possible for the script to automatically duplicate all those original Theme Adjuster settings and put under the correct new theme inside the INI ?
If not an option, I believe it's fine to do it manually.
.
Last edited by PhelixK; 03-13-2020 at 08:42 AM.
|
|
|
03-13-2020, 08:36 AM
|
#26
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Quote:
Originally Posted by amagalma
It could be done but the most difficult part would be the color selection.. There are about 350 colors in a theme.. How would one select what gets copied?
|
with ticking boxes ? :P
some colors of other themes are so nice on eyes but too much work to copy one by one color
|
|
|
03-13-2020, 04:41 PM
|
#27
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by PhelixK
Hi, perfect! -works fine on mac now.
A question regarding extended features in v6,
When using the color script on themes that are compatible with the Theme Adjuster in v6, I notice the script instantly resets all TA settings to default by creating a temporary entry called [adjusted__. This is of course to be expected due to the presence of a new theme file in the reaper-themeconfig.ini.
Then, when we decide to save as a new theme, I wonder if it would be possible for the script to automatically duplicate all those original Theme Adjuster settings and put under the correct new theme inside the INI ?
If not an option, I believe it's fine to do it manually.
.
|
I could do that
Last edited by amagalma; 03-13-2020 at 05:32 PM.
|
|
|
03-14-2020, 09:44 AM
|
#28
|
Human being with feelings
Join Date: Feb 2020
Location: germany
Posts: 384
|
Thank you so much for this script. Worked like a charm on my modified "Concerto" theme!
__________________
System: Win 10 64 bit / i9 9900K (8x 3.6 GHz) / 16 GB DDR4-3200 RAM / 1TB M.2 SSD + 2x 500 GB SSD / RME Babyface / Reaper
Tagirijus.de
|
|
|
03-17-2020, 10:26 AM
|
#29
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,721
|
Wow... just wow!
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
03-19-2020, 04:21 AM
|
#30
|
Human being with feelings
Join Date: Jul 2013
Location: Portugal
Posts: 1,827
|
For some reason i have this error. Just installed from reapack.
https://imgur.com/zK8kvhE
|
|
|
03-19-2020, 06:08 AM
|
#31
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by pepe44
|
Hmm.. This points to Lokasenna's GUI library.. Could you run the action " Set Lokasenna_GUI v2 library path.lua" and then try my script again? Thanks!
|
|
|
03-19-2020, 06:14 AM
|
#32
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
New version v1.35 on ReaPack
v1.35 changelog:
- Zipped themes support (ReaperThemeZip)
- The new saved adjusted theme inherits the old theme's "Default_6.0 theme adjuster" settings, if any
Last edited by amagalma; 03-19-2020 at 06:43 AM.
|
|
|
03-19-2020, 06:57 AM
|
#33
|
Human being with feelings
Join Date: Jul 2013
Location: Portugal
Posts: 1,827
|
Quote:
Originally Posted by amagalma
Hmm.. This points to Lokasenna's GUI library.. Could you run the action "Set Lokasenna_GUI v2 library path.lua" and then try my script again? Thanks!
|
I didnt have the lokasena installed, thanks a lot! working good now!
|
|
|
03-20-2020, 02:15 PM
|
#34
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
v1.40 changelog:
- Fixed bug with messed up recall of last undo setting when having deleted a previous one
- Now when moving the sliders, the new setting is automatically applied
- Mousewheel always adjusts by 1 (fine tunning) and needs a click on the slider to apply setting
- Changed slider behavior: clicking on the slider does not move the handle any more, but now it applies the setting - same as clicking on the Apply Settings button (useful after mousewheel)
|
|
|
03-21-2020, 02:54 AM
|
#35
|
Human being with feelings
Join Date: Mar 2019
Posts: 885
|
Quote:
Originally Posted by amagalma
v1.40 changelog:
- Fixed bug with messed up recall of last undo setting when having deleted a previous one
- Now when moving the sliders, the new setting is automatically applied
- Mousewheel always adjusts by 1 (fine tunning) and needs a click on the slider to apply setting
- Changed slider behavior: clicking on the slider does not move the handle any more, but now it applies the setting - same as clicking on the Apply Settings button (useful after mousewheel)
|
Hi, I updated the script from v1.25 to 1.40.
Only checked on macOS, haven't checked Win.
Maybe you forgot to make the corrections for mac and Linux as well?
1)
Here on mac it doesn't work on zip'ed themes.. tried on Def.6 and another.
Got the following error:
Failed to extract ReaperThemeZip file. Make sure you have 'unzip' installed.
On mac, I assume the call for 'unzip' would be 'Archive Utility'(?)
2)
Tried using the script on an unpacked theme.
When saving, I get the following error:
... m Scripts / Various / amagalma_Adjust theme colors_v1.40.lua: 381: attempting to index a null value (update 'ReaperThemeName')
- the new theme is still saved or overwritten if using the same name.
- and the new theme loads with the correct color adjustments
- But, the Theme Adjuster settings are lost, whether it is standard or a custom version of TA.
In reaper-themeconfig.ini, only this single entry is created:
[Adjusted__xyz-theme-name]
param22 = 100
.
Last edited by PhelixK; 03-21-2020 at 09:27 AM.
|
|
|
03-21-2020, 12:55 PM
|
#36
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Thanks for the report!
I'll check again about 1) .. About 2), it happens the same in windows, I'll fix it in a moment and upload 1.41.. The first is going to take more time because I don't have OSX or Linux to test
|
|
|
03-22-2020, 01:50 PM
|
#37
|
Human being with feelings
Join Date: Jan 2018
Location: London
Posts: 47
|
Hi amagalma,
I'm curious to try this script, but it's throwing this error for me:
Quote:
JS_ReaScriptAPI not installed
You have to install JS_ReaScriptAPI for this script to work. Would you like to open the relative web page in your browser?
|
I've got reaper_js_ReaScriptAPI32.dylib installed in the UserPlugins folder.
I'm not expecting my old 32bit system to be supported, but if it did happen to be an easy fix...
Whatever though, thanks for your script. :-)
__________________
REAPER latest
macOS 13.6.6
|
|
|
03-22-2020, 05:17 PM
|
#38
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by creator31
Hi amagalma,
I'm curious to try this script, but it's throwing this error for me:
I've got reaper_js_ReaScriptAPI32.dylib installed in the UserPlugins folder.
I'm not expecting my old 32bit system to be supported, but if it did happen to be an easy fix...
Whatever though, thanks for your script. :-)
|
Are you sure the JS_ReaScriptAPI is correctly installed?
Action 40027: "Show REAPER resource path in explorer", open folder UserPlugins, place inside the correct file for your system and restart Reaper twice.
|
|
|
03-22-2020, 05:26 PM
|
#39
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
v1.41 changelog:
- Fixed crashing while saving unzipped files (introduced in 1.40)
v1.42 changelog:
- The extraction code should now work in OSX/Linux too (thanks cfillion again!)
|
|
|
03-23-2020, 05:12 AM
|
#40
|
Human being with feelings
Join Date: Aug 2019
Posts: 59
|
Thanks a lot amalgama, love the possibility to apply the changes on the fly!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 11:58 AM.
|