It is currently April 25th, 2024, 7:46 am

Gradient angle in relation to time

Get help with creating, editing & fixing problems with skins
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Gradient angle in relation to time

Post by FuzzyLizard530 »

When using solidcolor and solidcolor2, how do I get the gradientangle to rotate with a 24-hour clock? I've tried a couple of different methods, but to no avail. Ideas?
I may or may not have a signature in this, very location...
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradient angle in relation to time

Post by balala »

Code: Select all

[Rainmeter]
Update=1000

[MeasureHours]
Measure=Time
Format=%#H

[MeasureMinutes]
Measure=Time
Format=%#M

[MeasureAngle]
Measure=Calc
Formula=(( 60 * MeasureHours + MeasureMinutes ) / 4 )

[MeterBackground]
Meter=Image
SolidColor=255,0,0
SolidColor2=0,255,0
GradientAngle=[MeasureAngle]
X=0
Y=0
W=150
H=150
DynamicVariables=1
Here the [MeasureAngle] measure returns the number of minutes since the last midnight. The number of minutes in a day is equal with 1440 and with a rule of three you can determine the rotation angle, corresponding to the current moment of the day. That is used in the GradientAngle option of the image meter.
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: Gradient angle in relation to time

Post by FuzzyLizard530 »

I think that helped but I'm still having trouble with a skin. I should be able to upload it tonight for someone to pick apart and figure out what I may have screwed up.

...to be continued...
I may or may not have a signature in this, very location...
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: Gradient angle in relation to time

Post by FuzzyLizard530 »

FuzzyLizard530 wrote:I think that helped but I'm still having trouble with a skin. I should be able to upload it tonight for someone to pick apart and figure out what I may have screwed up.

...to be continued...
Well that took longer than expected... fml... :oops:

At any rate:
MineClock_0.0.1.rmskin
There's 2 skins in here. The one that opens up SHOULD be the one I'm wanting to rotate the gradient on, the other one being the one I want it to mirror [in color only, hence the gradient].

I have a slightly modified version [mostly just names of variables/options/sections. Shouldn't change anything, right?] of the code you/balala had above [with some of my own code commented out, because I'm apparently not the mathematician I thought I was. :p]
You do not have the required permissions to view the files attached to this post.
I may or may not have a signature in this, very location...
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradient angle in relation to time

Post by balala »

And do you have any question about these codes?
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: Gradient angle in relation to time

Post by FuzzyLizard530 »

balala wrote:And do you have any question about these codes?
FuzzyLizard530 wrote:I think that helped but I'm still having trouble with a skin. I should be able to upload it tonight for someone to pick apart and figure out what I may have screwed up.
...
There's 2 skins in here. The one that opens up SHOULD be the one I'm wanting to rotate the gradient on, the other one being the one I want it to mirror [in color only, hence the gradient].

I have a slightly modified version [mostly just names of variables/options/sections. Shouldn't change anything, right?] of the code you/balala had above [with some of my own code commented out, because I'm apparently not the mathematician I thought I was. :p]
As a matter of fact... Yes! As far as I can tell, I'm not getting anything. It doesn't seem to move at all. I check it at any time of day, and Solidcolor1 and Solidcolor2 are still in the same places they were every time. :/ also, if it's stuck at the starting angle, I need to change it do that it starts with one of the colors at the top. Doesn't matter which, I can fix that once I get everything else in order.
I may or may not have a signature in this, very location...
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradient angle in relation to time

Post by balala »

FuzzyLizard530 wrote:As far as I can tell, I'm not getting anything. It doesn't seem to move at all.
But it is! Only that the visible part of the [MeterHours] is too small. This meter is hidden behind the [MeterFront] meter and we can see only a small part of it. Reduce its height, to be the same as its width (H=80).
To confirm, replace for a moment the Formula option of the [TimeRot] measure, with Formula=( 6 * MeasureSecs ). Because the number of seconds is between 0 and 59, this formula will return a number between 0 and 354, so into one minute a complet turn will occur. Now you can better see how the colors are rotating (don't forget to restore the original formula).
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: Gradient angle in relation to time

Post by FuzzyLizard530 »

Image

I feel like an idiot now! LOL! Thanks! Works perfectly!
I may or may not have a signature in this, very location...
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradient angle in relation to time

Post by balala »

Glad to help.
User avatar
FuzzyLizard530
Posts: 75
Joined: August 5th, 2014, 2:09 am

Re: Gradient angle in relation to time

Post by FuzzyLizard530 »

Been a while [Life... Sheesh!] I've been pretty happy with the results overall, but I did have a curiosity pique my interest:

Would it be possible to have the rotation adjusted, say, on a daily basis by the sunrise/sunset time pulled from a given weather site? and How much trouble would it be?
I may or may not have a signature in this, very location...