It is currently July 30th, 2021, 4:37 am

Color Menu v1.0.2

Skins to open folders and launch applications and websites
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Color Menu v1.0.2

Post by theimmersion »

Hi everyone. I recently released my first skin in public and thought my first skin ever should be a tool of sorts that i use myself to make creating skins easier. So this is a color picker that i tried to make as native to rainmeter as possible without need external programs for that. You can essentially make any skin compatible with it without much trouble once you get the hang of it. I really want some feedback on it. Might be intimidating at first, and sadly, its still buggy but im working on it.
The only thing you need is the MouseXY plugin from here:
https://www.deviantart.com/users/outgoing?https://forum.rainmeter.net/viewtopic.php?t=22900

Here's the link to it on DeviantArt:
https://prototype-0153.deviantart.com/art/Color-Menu-1-0-0-703022799

Its been an old skin but it worked fine for me as is while making skins but now i wanted to release it and im gonna do my best to make it perfect and 100% functional. If anyone has an idea whats wrong, do share.
Still better than going into Skin.ini and change xxx,xxx,xxx,xxx color values a thousand times before you like the color on a skin your making. xD

For any questions or suggestions feel free to ask. :)
ENJOY!

CHANGELOG
v1.0.2
Fixed first time startup errors in logs. (hopefully)
v1.0.1
Made a workaround to the slider reset bug by introducing the old days slider behavior. Lets see gow it goes.
Added a first time startup setup to the skin.
v1.0.0
Made the initial skin a looooong time ago, no idea what i changed back than.
Last edited by theimmersion on September 10th, 2017, 1:52 pm, edited 3 times in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4329
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Color Menu

Post by eclectic-tech »

Nice work! 8-)

First issue I encountered was multiple errors filling the log continuously when loaded. This is because you hard-coded the "ConfigPath" variable in "Config.inc" included file to your username.
Corrected by using the environment variable %UserProfile% in "Config.inc":

Code: Select all

[Variables]
ConfigPath=%UserProfile%\Documents\Rainmeter\Skins\Tools\@Resources\
SkinPath=Tools\Color Menu
Then I noticed the initial values of variable vColorRGBA was set to "vColorRGBA"... heh, okay... and it never changed. I found where you were setting this variable in your code in the [Preview] section, and found what I think is a typo in your bang... modified the name of the variable from "#vColorRGBA#" to "vColorRGBA" in both !SetVariable and !WriteKeyValue bangs.

Code: Select all

[Preview]
Meter=Shape
Shape=Rectangle 0,0,100,100,100 | Fill Color [Counter1Red:X],[Counter1Green:X],[Counter1Blue:X],[Counter1Opacity:X] | StrokeWidth 0
DynamicVariables=1
X=470
Y=87
Group=Refresh
LeftMouseUpAction=[!SetVariable "vColorRGBA" "[Counter1Red:X],[Counter1Green:X],[Counter1Blue:X],[Counter1Opacity:X]" "#SkinPath#"] [!WriteKeyValue "Variables" "vColorRGBA" "[Counter1Red:X],[Counter1Green:X],[Counter1Blue:X],[Counter1Opacity:X]" "#ConfigPath#\Colors.inc"] #R# [!Redraw "*"]
; [!SetVariable vColorR "( [Counter1Red:X] - #vColor1Red# )" "#SkinPath#"] [!SetVariable vColorG "( [Counter1Green:X] - #vColor1Green# )" "#SkinPath#"] [!SetVariable vColorB "( [Counter1Blue:X] - #vColor1Blue# )" "#SkinPath#"] [!SetVariable vColorO "( [Counter1Opacity:X] - #vColor1Opacity# )" "#SkinPath#"] #R#
MouseOverAction=[!ShowMeterGroup "Notification"][!ShowMeterGroup "ApplyNotification"]#R#
MouseLeaveAction=[!HideMeterGroup "CloseNotification"]#R#
I haven't gotten time to look at the drag issue, but it is doing the same thing here "Resets to zero when drag mouse button is released".

Still looking at your creation, and will let you know if I find any other issues. :thumbup:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4329
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Color Menu

Post by eclectic-tech »

EDIT: I overlooked that you are trying to integrate this was a tool for use in other skins, so disregard my suggestion concerning the "ConfigPath" variable.

Well, now I am getting more errors in the Log... invalid bangs whenever the mouse moves over the blue or opacity meters.
You cannot make up your own bang actions... you coded bangs for !Opacityraw and !Blueraw :jawdrop
You probably meant something else, but I cannot follow what your action should be.

SOLUTION: Replace all instances of [!Opacityraw] and [!Blueraw} with [!Redraw "*"]

Slider resetting to zero happens on the mouse leave action in [SliderButton2...] of each RGBA section.

SOLUTION: For now, removing that MouseLeaveAction in those sections, allows the sliders to work as expected.

One other note related to the hard-coded "ConfigPath" variable, in your "Close" action, you write the current path to the "Config.inc" file, so the %UserProfile% variable is overwritten :confused: Not sure why you are doing all those actions on "Close", why not just !Deactivate the config?

Rather than using your created variables to point to the resources folder, simply use #@#Config.inc to indicate that file or #@#colors.inc for that included file. See #@#Resources reference

I'll wait for an update before looking any deeper into this for now... :oops:
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Re: Color Menu

Post by theimmersion »

HAHA, the [!Opacityraw] and [!Blueraw} were my mistakes when using replace multiple words. xD
Will fix and post an update. xD
Sorry. But yeah, i assume it will show errors at least when startup since i didnt set all to NULL but even than, first startup will always show errors until the skin sets its variables right when closed. The ConfigPath is dynamic. Do disregard those and the skin should still work even with those mistakes without a problem. Except the sliding of course.

vColorRGBA is for external skins. I suggest you download the demo skin showing how it works. The vColorRGBA is being set by external skins and than used as the variable name for that external skin so be saved in its own config file.

So ill look into why removing the MouseLeaveAction fixes it or rather why MouseLeaveAction makes the sliders reset.
Those are there so when you move your mouse too far out the sliders cant know if you released the mouse to commit and it will keep dragging until you go back on the knob and release the mouse. So i found a solution that when you move the mouse to far away from the knobs, they commit instead. But seems like that is misbehaving somehow. Ill try fix it.

Thanks for the detailed info!

EDIT:
So ive fiddled with the MouseLeaveAction and logic tells me it should work fine but it doenst. It is in fact doing the reset on dragging but without it has that old slider bug from the old days of computer software. xD
Some might remember those days. xD
Nothing annoyed me more than when i clicked to drag some slider and if i move mouse away from it and release the button, the slider would still move back and forth. So i gotta find a different solution for it. Hm... Any ideas appreciated.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4329
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Color Menu v1.0.1

Post by eclectic-tech »

C'mon man! :( ... When v1.01 is loaded, again it continuously fills the log with syntax errors! :twisted:

Most users who download a skin that continually fills the log with 1000's of error messages, will simply delete the skin, and never attempt to use it.
You need to fix that issue if you want anyone to even try this... :x

You need to at least set the initial values of ConfigPath and SkinPath variables to existing paths, not to NULL :uhuh:
Set ConfigPath=#@# and set SkinPath=Tools\Color Menu; the included resources in your skin package.
The end user can read your comments and change them later.

You need to correct the bang that sets the vColorRGBA variable; currently you are setting the variable value and not the variable itself. #vColorRGBA# is the variable value, vColorRGBA is the actual variable name.

I think you might want to look at the mouse plugin to control dragging to change values.
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Re: Color Menu v1.0.1

Post by theimmersion »

Well, that escalated quickly...

Dude, chill. xD
Let me make myself clear, there will always be errors with skins that are meant to work in conjunction with other skins.
There are two types of errors, generic ones that can be disregarded because thats how the main software handles things.
And there are bad errors, that of course need fixing.
You can fix a generic errors by simply adding lots and lots of Calc measure to do comparisons and check conditions but than you swap a one simple generic error thats more of a notice than an error into a process that is:
A. More code thats not really that relevant.
B. Potentially add more stuff that can brake.
C. Potentially add to the process hogging.
Secondly, some errors are same like the notice of it being refreshed or whatever.
Thirdly, even multi billion companies have their software that get errors.
The difference, im a noob / the errors are accessible to users who dont know what to do with it most of the times / for nitpickers or people with OCD or what ever its called. xD
Lastly, what is it with you and the vColorRGBA? I suggest you take a look 10 more times, maybe youll get it. xD

Ill try explain simply (imagine some random skin being Skin XXX): :???:
vColorRGBA can have whatever the hell value on its own. Its not important for Color Menu itself, its for the other skins.
vColorRGBA is a variable that is being set by external skins.
External skin sets vColorRGBA to a name that will be used as a variable name later in the Colors.inc.
So Skin XXX has background element and uses vBlah variable to set its color located in its Color.inc.
When you click an element that is meant to be recolored (like the background), Skin XXX sets vColorRGBA variable to vBlah.
Now, when you click apply in Color Menu, it will read vColorRGBA as vBlah and save a new color in the Skin XXX Color.inc as vBlah and not vColorRGBA.
That is the only instance vColorRGBA is used and is only for other skins. If you use Color Menu without actually using any skin for it, it will simply save whatever the default value of vColorRGBA is in Color Menu Color.inc instead.
So i actually purposefully set it to its own name as an easy way to check and debug it.
Its thanks to that that after all these years, when i went back to edit it, i instantly knew what the hell that last entry was in Color Menu Color.inc. xD
Get it?
Honestly, i was smarter back than. I dont use that trick so much anymore. xD
Than i get to an old skin to change, modify or upgrade and have no clue whats what, have to pathfind every element what its doing and why etc. Fun times.
But i digress...
The side effect of this approach is that every time Skin XXX clicks on an element that can be recolored and Color Menu is not running, an error will be logged because Skin XXX is trying to set a variable while the target skin isnt loaded.
Cant get around that.
So whatever you think you might know about vColorRGBA, you dont. Stop thinking about it! It will make you insane! :P ;) xD

Also, the skin is very old. Im trying to fix it by remembering the ins and outs of it how i wrote it back than. Need time.
Also, not a pro. Also also, where do you see those "syntax errors" and are you actually referring to actual errors from rainmeter or some syntax addon for notepad++ that went fubar? xD

Thanks for the mouse plugin tho, will play around with it.
Dont know what else to tell you. Everything works peachy on my end. :confused:
User avatar
jsmorley
Developer
Posts: 21990
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Color Menu v1.0.1

Post by jsmorley »

I would not run any skin that produced even one single error in the log. I would either find a way to fix it, or just not use it. Any skin that spammed my log with error messages once a second would just be deleted.

This is what I want when I refresh Rainmeter. Although I run 20+ skins, it's what I get...
1.png
There is generally a way to set measures to "disabled" initially, or set them with some starting option that doesn't cause an error, then enable them or change the option with !SetOption when the time is right, to avoid errors. It depends on the skin and the design of course, but it would be something I would work hard at. No errors at all is my goal, and anything less is a failure that I wouldn't be happy with.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4329
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Color Menu v1.0.1

Post by eclectic-tech »

Sorry, if my suggestions seem too critical. I did misunderstand how you are using vColorRGBA; perhaps a more descriptive name may have avoided that, something like "AppliedColor".

But that aside, it is up to you what you want to put out, but a skin that immediately fills the log with errors when loaded is going to discourage a lot of potential users. You asked what I see, here is the log after loading your skin: (click to animate):
WTF.gif
Good luck with your project.
You do not have the required permissions to view the files attached to this post.
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Re: Color Menu v1.0.1

Post by theimmersion »

What the hell?! I dont get those errors at all. o.O
And since the skin works, id guess the syntax supposed to be fine than as well?
I still stand my ground on some errors but this is something else.
Untitled.png
Thats how it looks for me.

The only error that supposed to slip through is one where a skin is trying to set the vColorsRGBA without Color Menu being loaded.
And even that can be avoided with clever coding which ill update in the demo skin on how to do once i find the best solution.
How can i debug it if it works fine on my end, what can that be?
Tho, im running Rainmeter 4.0.0 r2746 64-bit. Does the r2858 beta have something that my version doesnt? I dont see any Syntax errors ever.
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4329
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Color Menu v1.0.1

Post by eclectic-tech »

The errors are caused because you did not specify an existing path to your included files; you set them to "NULL" in the last version.

You can eliminate those by setting the initial values to "ConfigPath=#@#" and "SkinPath=Tools\Color Menu" in your included config file.

Without those values, the "@include=#ConfigPath#colors.inc" file is not found, so your color variables do not exist, and those recurring errors will fill the log of any user who installs it.