It is currently March 29th, 2024, 1:08 pm

Ring Clock

Clocks and timer skins
User avatar
DavidRGreen
Posts: 35
Joined: May 5th, 2020, 10:19 am

Ring Clock

Post by DavidRGreen »

I thought it was about time that I built a Clock to go with the rest of my skins (which I still think of as widgets)

Image

Does it need explanation?
The bar from the centre to the white ring is the hour. The Black dot running around the white ring is the minutes, and the White dot running around the outside of the white ring is the seconds.
The date in typed form is displayed on the right, in an interesting typeface.
Ring Clock_1.0.rmskin
The face is made of 3 nested Ellipse shapes, which seemed a fairly straight forward way of doing this. What frustrated me was for the minute ring, I used the code;

Code: Select all

Shape2=Ellipse 50,50,40 | Fill Color=255,255,255
which I thought would produce a white disc, which would be partly covered by the smaller third disk in black leaving a ring shape. But no, it was coloured blue (like 0,255,255). Even adding 255 for the alpha value to one or all of the shapes did nothing.
I only got white by deleting the 'fill color' parameter, then the default was effected, and it worked. I know that specifying default values is redundant, and it makes for 'documenting' to an extent, but I expected it to work…
You do not have the required permissions to view the files attached to this post.
Last edited by DavidRGreen on June 12th, 2020, 12:17 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Ring Clock

Post by jsmorley »

DavidRGreen wrote: June 12th, 2020, 10:59 am I thought it was about time that I built a Clock to go with the rest of my skins (which I still think of as widgets)

Image

Does it need explanation?
The bar from the centre to the white ring is the hour. The Black dot running around the white ring is the minutes, and the White dot running around the outside of the white ring is the seconds.
The date in typed form is displayed on the right, in an interesting typeface.

Ring Clock_1.0.rmskin

The face is made of 3 nested Ellipse shapes, which seemed a fairly straight forward way of doing this. What frustrated me was for the minute ring, I used the code;

Code: Select all

Shape2=Ellipse 50,50,40 | Fill Color=255,255,255
which I thought would produce a white disc, which would be partly covered by the smaller third disk in black leaving a ring shape. But no, it was coloured blue (like 0,255,255). Even adding 255 for the alpha value to one or all of the shapes did nothing.
I only got white by deleting the 'fill color' parameter, then the default was effected, and it worked. I know that specifying default values is redundant, and it makes for 'documenting' to an extent, but I expected it to work…
It's not

Shape2=Ellipse 50,50,40 | Fill Color=255,255,255

It's

Shape2=Ellipse 50,50,40 | Fill Color 255,255,255

You don't use equal = signs to define parameters.
User avatar
DavidRGreen
Posts: 35
Joined: May 5th, 2020, 10:19 am

Re: Ring Clock

Post by DavidRGreen »

Thanks jsmorley!

One uses the equals sign so much between a parameter and its setting value, it is all to easy to use it when it is not expected.
And the Rainmeter parser doesn't flag it as a syntax error, but parsed "=255" as 0.
… an error or warning message in the log would've been helpful :)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Ring Clock

Post by balala »

The other two Shape options of the same [ClockFace] meter have the same issue: Shape=Ellipse 50,50,50 | Fill Color=0,0,0 and Shape3=Ellipse 50,50,30 | Fill Color=0,0,0.
What I can't understand is why with the wrong Fill Color parameter the appropriate ring becomes blue (in fact is colored to 0,255,255). For instance Shape=Ellipse 50,50,50 | Fill Color 255,255,255 gives a white shape, but Shape=Ellipse 50,50,50 | Fill Color=255,255,255 gives a blue one, like it would renounce to the red parameter of the color (exactly as Shape=Ellipse 50,50,50 | Fill Color 0,255,255). For Shape=Ellipse 50,50,50 | Fill Color=255,240,0 (if written correctly would be yellow) you get same result as for Shape=Ellipse 50,50,50 | Fill Color 0,240,0 (green).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Ring Clock

Post by jsmorley »

DavidRGreen wrote: June 12th, 2020, 12:10 pm Thanks jsmorley!

One uses the equals sign so much between a parameter and its setting value, it is all to easy to use it when it is not expected.
And the Rainmeter parser doesn't flag it as a syntax error, but parsed "=255" as 0.
… an error or warning message in the log would've been helpful :)

That's why it's important to both speak and think in the correct terminology. It's a "skin" not a "widget"... It's not that "skin" is a better or more logical name for it, it's just that it's the correct name, and accuracy matters when solving problems. 😁

By the same token, The correct way to think about Rainmeter is:

Option=Option Value

You don't use equals signs between parameters and the parameter value, you only use equals signs between Options and Option Values.

Shape2=Ellipse 50,50,40 | Fill Color 255,255,255

Shape2 is the Option, Ellipse 50,50,40 | Fill Color 255,255,255 is the Option Value.
255,255,255 is a parameter of Fill Color, and will never use an equals sign.

LeftMouseUpAction=[!ShowMeter "myMeter"]

LeftMouseUpAction is the Option, [!ShowMeter "myMeter"] is the Option Value.
"myMeter" is a parameter of !ShowMeter, and will never use an equals sign.


There is just no way we can individually trap and error all the myriad ways you can get it wrong in a Shape meter... 😏
User avatar
DavidRGreen
Posts: 35
Joined: May 5th, 2020, 10:19 am

Re: Ring Clock

Post by DavidRGreen »

I get what you are saying.
And it gets easier to avoid most syntax errors with experience, something that I am lacking with this environment (1 month so far).
I was merely indicating that when jumpping between colour statements like FontColor=255,255,255,255
and Fill Color 255,255,255,255, it is not difficult to insert an equal sign inappropriately…
Fluency should improve over the next months :)

Thanks for the support!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Ring Clock

Post by jsmorley »

DavidRGreen wrote: June 12th, 2020, 1:37 pm I get what you are saying.
And it gets easier to avoid most syntax errors with experience, something that I am lacking with this environment (1 month so far).
I was merely indicating that when jumpping between colour statements like FontColor=255,255,255,255
and Fill Color 255,255,255,255, it is not difficult to insert an equal sign inappropriately…
Fluency should improve over the next months :)

Thanks for the support!
I understand completely. I have done exactly that myself.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Ring Clock

Post by SilverAzide »

Probably doesn't hurt to remember that Rainmeter is using (or used?) the old Windows Win32 GetPrivateProfileString/WritePrivateProfileString APIs for reading and writing INI files. So the equals sign is what goes between the keyname and value (e.g., Keyname=Value). Putting extra equals signs in the value will probably cause major parsing issues, I would think.
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Ring Clock

Post by balala »

DavidRGreen wrote: June 12th, 2020, 1:37 pm I was merely indicating that when jumpping between colour statements like FontColor=255,255,255,255
and Fill Color 255,255,255,255, it is not difficult to insert an equal sign inappropriately…
But yes, it is, because FontColor=255,255,255,255 is an option and it does require an equality, while Fill Color 255,255,255,255 is a parameter of an option (Shape in this case), which doesn't need equality.
As a general rule, note that only up to one single equality is permeted per option (line).