It is currently March 29th, 2024, 12:55 pm

Clock,different color for current time

Get help with creating, editing & fixing problems with skins
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Clock,different color for current time

Post by xenium »

I would like to know if at this clock code it is possible, as always, that the last square, which indicates the current hour and minute, should have another color, for example, red ?

Thanks
Clock.zip
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock,different color for current time

Post by eclectic-tech »

It is possible. One way would be to add a new variable for the desired second color and then bangs, to the hours and minutes measures, that set the linecolor option for the (new) hours and minutes GROUPS, then sets the second color for the current hour and minute. I added a hash # to the time measures formulas to remove the leading zeros so they would match the hour and minute meter names.

Code: Select all

[Variables]
...
Color=255,255,255,255
Color2=255,0,0,255

[msHour]
Measure=Time
; Added # to remove leading zeros
Format=%#H
OnUpdateAction=[!SetOptionGroup Hours LineColor #Color#][!SetOption mHour[msHour] LineColor #Color2#]

[msMinute]
Measure=Time
; Added # to remove leading zeros
Format=%#M
OnUpdateAction=[!SetOptionGroup Minutes LineColor #Color#][!SetOption mMin[msMinute] LineColor #Color2#]
The hours and minutes meters are all using the style of the first meters, so to group all of the meters, simply add Group=Hours to the first hour meter and Group=Minutes to the first minute meter.

Code: Select all

...
[mHour1]
Group=Hours
Meter=Roundline
MeasureName=cHour1
StartAngle=[cAngle1]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#Hour1Length#
LineStart=#Hour1Start#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...

[mHour13]
Group=Hours
Meter=Roundline
MeasureName=cHour13
StartAngle=[cAngle13]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#Hour2Length#
LineStart=#Hour2Start#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...

[mMin1]
Group=Minutes
Meter=Roundline
MeasureName=cMinute1
StartAngle=[cMAngle1]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#MinuteLength#
LineStart=#MinuteStart#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...
EDIT: Hours above 12 use [mHour13] as the style, so you need to add Group=Hours to that meter... :x
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Clock,different color for current time

Post by xenium »

eclectic-tech wrote:It is possible. One way would be to add a new variable for the desired second color and then bangs, to the hours and minutes measures, that set the linecolor option for the (new) hours and minutes GROUPS, then sets the second color for the current hour and minute. I added a hash # to the time measures formulas to remove the leading zeros so they would match the hour and minute meter names.

Code: Select all

[Variables]
...
Color=255,255,255,255
Color2=255,0,0,255

[msHour]
Measure=Time
; Added # to remove leading zeros
Format=%#H
OnUpdateAction=[!SetOptionGroup Hours LineColor #Color#][!SetOption mHour[msHour] LineColor #Color2#]

[msMinute]
Measure=Time
; Added # to remove leading zeros
Format=%#M
OnUpdateAction=[!SetOptionGroup Minutes LineColor #Color#][!SetOption mMin[msMinute] LineColor #Color2#]
The hours and minutes meters are all using the style of the first meters, so to group all of the meters, simply add Group=Hours to the first hour meter and Group=Minutes to the first minute meter.

Code: Select all

...
[mHour1]
Group=Hours
Meter=Roundline
MeasureName=cHour1
StartAngle=[cAngle1]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#Hour1Length#
LineStart=#Hour1Start#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...

[mHour13]
Group=Hours
Meter=Roundline
MeasureName=cHour13
StartAngle=[cAngle13]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#Hour2Length#
LineStart=#Hour2Start#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...

[mMin1]
Group=Minutes
Meter=Roundline
MeasureName=cMinute1
StartAngle=[cMAngle1]
H=(#SecondLength#*2)
W=(#SecondLength#*2)
Solid=1
LineLength=#MinuteLength#
LineStart=#MinuteStart#
AntiAlias=1
LineColor=#Color#
DynamicVariables=1

...
EDIT: Hours above 12 use [mHour13] as the style, so you need to add Group=Hours to that meter... :x
:17good
Thank you very much !
:beer: :beer: :beer:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock,different color for current time

Post by eclectic-tech »

Happy to help.