It is currently September 21st, 2020, 3:18 am

Clock face based on the sunset and sunrise

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

the1ulike wrote: June 20th, 2020, 9:18 am You are right, the "skyColor" is not reflecting the weather effect on it. I'm interested in the offline approach without colors, just black and while
Still not clear enough: gradually change or just black (on nighttime, I suppose) and white (on daytime). Because these are not the same.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

Is there a package to download and work with? Am I missing it, because can't find it?
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 20th, 2020, 5:44 pm Still not clear enough: gradually change or just black (on nighttime, I suppose) and white (on daytime). Because these are not the same.
For the online version, we have it back at night and white at day.
The task is: at the time of change, let's say for 10 min will be gradually changing from white to black or from black to white.
Let's say at the time of sunset, the face will be orange, so for 5 min will move from white to orange, then 5 min from orange to black
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 20th, 2020, 5:53 pm Is there a package to download and work with? Am I missing it, because can't find it?
current code I have:

Code: Select all

[Variables]
; geo Location ID number from time.yandex 
; location at 'city'.ini saved at the skin folder

[MeasureName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=600
Url="http://time.yandex.com/sync.json?lang=en&geo=#Location#"
;Debug=1
RegExp="(?siU).*"name":"(.*)".*"offset":(.*),"offsetString":"(.*)".*,"isNight":(.*),"
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1
 
; This returns an offset number for the defined city that tells you the current time UTC+14400000 
[MeasureOffset]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureName]
StringIndex=2
Substitute="":"0"

[MeasureTimeZone]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureName]
StringIndex=3
Substitute="UTC":""

[MeasureIsNight]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureName]
StringIndex=4
Substitute="true":"Night","false":"Day"
IfMatch=(?i)Night
IfMatchAction=[!ShowMeterGroup Night][!HideMeterGroup Day][!ShowMeter MeterSecondsHand][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!HideMeterGroup Night][!ShowMeterGroup Day][!ShowMeter MeterSecondsHand][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; Converts the offset value returned by the webparser to a timezone to determine the time at the defined location
; This is used as the source for the other time related values; year, month, day, etc.

[MeasureTime]
Measure=Time
Timezone=([MeasureOffset]/3600000)
DynamicVariables=1

[MeasureTime2]
Measure=Time
Timezone=([MeasureOffset]/3600000)
DynamicVariables=1
Format=%p

[MeasureYear]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%Y
DynamicVariables=1

[MeasureSeconds]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%S
DynamicVariables=1

[MeasureMonth]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%d %b
DynamicVariables=1

[MeasureDay]
Measure=Time
Format=%A 
TimeStamp=[MeasureTime:]
DynamicVariables=1

;**********************************************************************************
; METERS
;**********************************************************************************

[MeterClockFaceN]
Group=Night
Hidden=1
Meter=Image
ImageName=#@#Images\N.png
PreserveAspectRatio=1
X=0
Y=0
W=220
H=250

[MeterClockFaceD]
Group=Day
Hidden=1
Meter=Image
ImageName=#@#Images\D.png
PreserveAspectRatio=1
X=0
Y=0
W=220
H=250

;**********************************************************************************


[MeterDigitalTimeN]
Group=Night
Hidden=1
Meter=String
StringStyle=Bold
StringEffect=Shadow
FontColor=250,250,250
AntiAlias=1
MeasureName=MeasureTime2
StringAlign=CenterCenter
X=110
Y=218
FontSize=11
Text=%1



[MeterDigitalTime]
Group=Day
Hidden=1
Meter=String
StringStyle=Bold
StringEffect=Shadow
FontColor=10,10,10
AntiAlias=1
MeasureName=MeasureTime2
StringAlign=CenterCenter
X=110
Y=218
FontSize=11
Text=%1 

;**********************************************************************************

[MeterDigitalDayOfWeekN]
Group=Night
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontFace=Arial
AntiAlias=1
MeasureName=MeasureDay
StringAlign=CenterCenter
X=111
Y=150
FontSize=10
FontColor=255,255,255
Text=%1

[MeterDigitalDayOfWeek]
Group=Day
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontFace=Arial
AntiAlias=1
MeasureName=MeasureDay
StringAlign=CenterCenter
X=111
Y=150
FontSize=10
FontColor=0,0,0
Text=%1

;**********************************************************************************

[MeterDigitalDateN]
Group=Night
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=255,255,255
FontFace=Arial
AntiAlias=1
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
X=111
Y=165
FontSize=10
Text=%1 %2

[MeterDigitalDate]
Group=Day
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=0,0,0
FontFace=Arial
AntiAlias=1
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
X=111
Y=165
FontSize=10
Text=%1 %2

;**********************************************************************************

[MeterTZDisplayN]
Group=Night
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=255,255,255
AntiAlias=1
MeasureName=MeasureName
StringAlign=CenterCenter
X=111
Y=95
FontSize=11


[MeterTZDisplay]
Group=Day
Hidden=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=0,0,0
AntiAlias=1
MeasureName=MeasureName
StringAlign=CenterCenter
X=111
Y=95
FontSize=11

;**********************************************************************************
;************************************Clock Hands *******************************

[MeterHrHandN]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=40
LineColor=240,240,240
LineWidth=11
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=40
LineColor=0,0,0
LineWidth=11
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200

;**********************************************************************************

[MeterHrHand2N]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=43
LineLength=46
LineColor=240,240,240
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand2]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=43
LineLength=46
LineColor=0,0,0
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200

;**********************************************************************************

[MeterHrHand3N]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart= 49
LineLength=51
lineColor=240,240,240
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand3]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart= 49
LineLength=51
lineColor=0,0,0
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200

;**********************************************************************************

[MeterMinHandN]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=0
LineLength=60
LineColor=240,240,240
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=0
LineLength=60
LineColor=0,0,0
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterMinHand2N]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=62
LineLength=65
LineColor=240,240,240
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand2]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=62
LineLength=65
LineColor=0,0,0
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterMinHand3N]
Group=Night
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=67
LineLength=69
LineColor=240,240,240
LineWidth=5
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand3]
Group=Day
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=67
LineLength=69
LineColor=0,0,0
LineWidth=5
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterSecondsHand]
Hidden=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=95
LineColor=255,0,0,150
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=60

;**********************************************************************************

[CenterN]
Group=Night
Hidden=1
Meter=Image
ImageName=#@#Images\gen_dotN.png
X=0
Y=20
W=220
H=220

[Center]
Group=Day
Hidden=1
Meter=Image
ImageName=#@#Images\gen_dot.png
X=0
Y=20
W=220
H=220

;**********************************************************************************
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

the1ulike wrote: June 21st, 2020, 7:19 am current code I have:
Alright, but a lot of resources (image files) are also required. That's why I asked for a package, which should contain the involved resources as well.
So, please help us to can help you and provide a complete package. Would be much easier to help.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4112
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

balala wrote: June 21st, 2020, 8:29 am Alright, but a lot of resources (image files) are also required. That's why I asked for a package, which should contain the involved resources as well.
So, please help us to can help you and provide a complete package. Would be much easier to help.
The images were in an earlier post: https://forum.rainmeter.net/viewtopic.php?f=5&t=35493#p178558

I can create a package, but first the code above is also missing the "Location' variable.
Here are a list of several you can use to test:

Code: Select all

[Variables]
; geo ID number from time.yandex for Detroit Michigan
Location=89
; Melbourne AU geo ID = 21265
; Detroit Mi geo ID = 89
; Moscow RU geo ID = 213
; Los Angeles CA geo ID = 200
; Honolulu HA geo ID = 10119
; Singapore geo ID = 10619
There are several issues that will need to be dealt with to do this. The sunrise/sunset times need to be determined, then tested against the current time, and an action timer needs to be created to control the change over time.

The first problem I see with trying to gradually change the clock colors is the current version uses 2 static images with integrated numerals; a white face with black numerals and a black face with white numerals. Changing from one to the other is done instantly when the day/night value is measured. You can change the day image gradually from white to black using ImageTint, but the numerals, bezel, and clock hands will disappear, you will only see a black circle with a second hand.

To gradually change the clock face colors would involve not only the clock face and numerals but also all of the other elements: clock hands, city, date, AM/PM, etc. from black during the day to white at night.

One way this could be done is by creating an "alpha' variable and applying it to the day/night images and element colors. But the results may not be aesthetically appealing since the images will transition from white, through a murky semi-transparent grey, to black and visa-versa.

clockfade2.gif
Sped up transition from black to white

Here is a new skin version that removes groups and shows all meter but controls them using a new variable named 'FaceAlpha'.

The sunrise and sunset webparser values are converted to time measures, then compared with the current time plus/minus 900 seconds (15 minutes) and if the condition is met, the action timer is activated and the alpha value changes every 30 seconds in steps of 5, between 0 and 255 over a 30 minute interval. That value is used in every meter to control the alpha (visibility) of each day/night meter.

Note: I removed all Groups designations, removed all 'Hidden=1', and added FaceAlpha formulas to all FontColors and ImageAlpha values. Along with adding the needed measures to test time and transition the FaceAlpha value.

Code: Select all

[Variables]
; geo ID number from time.yandex for Detroit Michigan
Location=89
; London UK geo ID = 10393
; Melbourne AU geo ID = 21265
; Detroit Mi geo ID = 89
; Moscow RU geo ID = 213
; Los Angeles CA geo ID = 200
; Honolulu HA geo ID = 10119
; Singapore geo ID = 10619
FaceAlpha=255

; Location
[MeasureName]
Measure=WebParser
Url="https://time.yandex.com/sync.json?lang=en&geo=#Location#"
;Debug=2
RegExp="(?si).*"name":"(.*)".*"offset":(.*),"offsetString":"(.*)",.*"sunrise":"(.*)".*"sunset":"(.*)".*"isNight":(.*),"skyColor":.*"
;StringIndex=1
;DecodeCharacterReference=1
FinishAction=[!EnableMeasureGroup Time][!UpdateMeasureGroup Time]

[MeasureCity]
Measure=WebParser
Url=[MeasureName]
StringIndex=1
DecodeCharacterReference=1

; This returns an offset number for the defined city that tells you the current time UTC+14400000 
[MeasureOffset]
Measure=WebParser
Url=[MeasureName]
StringIndex=2
Substitute="":"0"

[MeasureTimeZone]
Measure=WebParser
Url=[MeasureName]
StringIndex=3
Substitute="UTC":""

[MeasureSunrise]
Measure=WebParser
Url=[MeasureName]
StringIndex=4

[MeasureSunriseTime]
Group=Time
Disabled=1
Measure=Time
TimeStamp=[MeasureSunrise]T[MeasureYear] [MeasureMonth] [MeasureDay]
TimeStampFormat=%H:%MT%Y %#d %b %A
DynamicVariables=1

[MeasureSunset]
Measure=WebParser
Url=[MeasureName]
StringIndex=5

[MeasureSunsetTime]
Group=Time
Disabled=1
Measure=Time
TimeStamp=[MeasureSunset]T[MeasureYear] [MeasureMonth] [MeasureDay]
TimeStampFormat=%H:%MT%Y %#d %b %A
DynamicVariables=1

[MeasureDawn]
Group=Time
Disabled=1
Measure=Calc
Formula=Abs([MeasureSunriseTime:TimeStamp]-[MeasureTime:])

IfCondition=((Abs([MeasureSunriseTime:TimeStamp]-[MeasureTime:]))<=900)

IfTrueAction=[!CommandMeasure MeasureActionTimer "Stop 1"][!CommandMeasure MeasureActionTimer "Stop 2"][!CommandMeasure MeasureActionTimer "Execute 1"]
IfFalseAction=[]

IfCondition2=([MeasureTime:]>([MeasureSunriseTime:TimeStamp]+900))
IfTrueAction2=[!SetVariable FaceAlpha 255][!UpdateMeter *][!Redraw]
IfFalseAction2=[]

DynamicVariables=1

[MeasureDusk]
Group=Time
Disabled=1
Measure=Calc
Formula=Abs([MeasureSunsetTime:TimeStamp]-[MeasureTime:])

IfCondition=((Abs([MeasureSunsetTime:TimeStamp]-[MeasureTime:]))<=900)

IfTrueAction=[!CommandMeasure MeasureActionTimer "Stop 1"][!CommandMeasure MeasureActionTimer "Stop 2"][!CommandMeasure MeasureActionTimer "Execute 2"]
IfFalseAction=[]

IfCondition2=([MeasureTime:]>([MeasureSunsetTime:TimeStamp]+900))
IfTrueAction2=[!SetVariable FaceAlpha 0][!UpdateMeter *][!Redraw]
IfFalseAction2=[]

DynamicVariables=1

[MeasureActionTimer]
Measure=Plugin
Plugin=ActionTimer

ActionList1=Repeat Dawn, 30000, 60 | SetDayFace
ActionList2=Repeat Dusk, 30000, 60 | SetNightFace

Dawn=[!SetVariable FaceAlpha "(Clamp(#FaceAlpha# + 5,0,255))"][!UpdateMeasure *][!UpdateMeter *][!Redraw]
Dusk=[!SetVariable FaceAlpha "(Clamp(#FaceAlpha# - 5,0,255))"][!UpdateMeasure *][!UpdateMeter *][!Redraw]
SetDayFace=[!SetVariable FaceAlpha 255][!UpdateMeter *][!Redraw]
SetNightFace=[!SetVariable FaceAlpha 0][!UpdateMeter *][!Redraw]

DynamicVariables=1

; 'FaceAlpha' is used to control visibility
; The value usually changes a quite a while after sunrise/sunset so the alpha transition happens first
: This will set the clock face when the skin is loaded/refreshed and when the 'IsNight' value changes
[MeasureDayNight]
Measure=WebParser
Url=[MeasureName]
StringIndex=6
Substitute="true":"Night","false":"Day"
IfMatch=(?i)Night
IfMatchAction=[!SetVariable FaceAlpha 0][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetVariable FaceAlpha 255][!UpdateMeter *][!Redraw]

; Converts the offset value returned by the webparser to a timezone to determine the time at the defined location
; This is used as the source for the other time related values; year, month, day, etc.

[MeasureTime]
Measure=Time
Timezone=([MeasureOffset]/3600000)
DynamicVariables=1

[MeasureTime2]
Measure=Time
Timezone=([MeasureOffset]/3600000)
DynamicVariables=1
Format=%p

[MeasureTime3]
Measure=Time
Timezone=([MeasureOffset]/3600000)
DynamicVariables=1
Format=%H:%M

[MeasureYear]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%Y
DynamicVariables=1

[MeasureSeconds]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%S
DynamicVariables=1

[MeasureMonth]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%d %b
DynamicVariables=1

[MeasureDay]
Measure=Time
Format=%A 
TimeStamp=[MeasureTime:]
DynamicVariables=1

;**********************************************************************************
; METERS
;**********************************************************************************

[MeterClockFaceN]
Meter=Image
ImageName=#@#Images\N.png
PreserveAspectRatio=1
ImageAlpha=(255-#FaceAlpha#)
X=0
Y=0
W=220
H=250
DynamicVariables=1

[MeterClockFaceD]
Meter=Image
ImageName=#@#Images\D.png
PreserveAspectRatio=1
ImageAlpha=#FaceAlpha#
X=0
Y=0
W=220
H=250
DynamicVariables=1

;**********************************************************************************


[MeterDigitalTimeN]
Group=Night
DynamicVariables=1
Meter=String
StringStyle=Bold
;StringEffect=Shadow
FontColor=250,250,250,(255-#FaceAlpha#)
AntiAlias=1
MeasureName=MeasureTime2
StringAlign=CenterCenter
X=110
Y=218
FontSize=11
Text=%1



[MeterDigitalTime]
Group=Day
DynamicVariables=1
Meter=String
StringStyle=Bold
;StringEffect=Shadow
FontColor=10,10,10,#FaceAlpha#
AntiAlias=1
MeasureName=MeasureTime2
StringAlign=CenterCenter
X=110
Y=218
FontSize=11
Text=%1 

;**********************************************************************************

;[MeterDigitalClock]
;Meter=String
;StringStyle=Bold
;StringEffect=Shadow
;FontColor=255,0,0,150
;AntiAlias=1
;MeasureName=MeasureTime3
;StringAlign=CenterCenter
;X=110
;Y=180
;FontSize=10
;Text=%1 

;**********************************************************************************

[MeterDigitalDayOfWeekN]
Group=Night
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontFace=Arial
AntiAlias=1
MeasureName=MeasureDay
StringAlign=CenterCenter
X=111
Y=150
FontSize=10
FontColor=255,255,255,(255-#FaceAlpha#)
Text=%1

[MeterDigitalDayOfWeek]
Group=Day
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontFace=Arial
AntiAlias=1
MeasureName=MeasureDay
StringAlign=CenterCenter
X=111
Y=150
FontSize=10
FontColor=0,0,0,#FaceAlpha#
Text=%1

;**********************************************************************************

[MeterDigitalDateN]
Group=Night
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=255,255,255,(255-#FaceAlpha#)
FontFace=Arial
AntiAlias=1
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
X=111
Y=165
FontSize=10
Text=%1 %2

[MeterDigitalDate]
Group=Day
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=0,0,0,#FaceAlpha#
FontFace=Arial
AntiAlias=1
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
X=111
Y=165
FontSize=10
Text=%1 %2

;**********************************************************************************

[MeterTZDisplayN]
Group=Night
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=255,255,255,(255-#FaceAlpha#)
AntiAlias=1
MeasureName=MeasureCity
StringAlign=CenterCenter
X=111
Y=95
FontSize=11


[MeterTZDisplay]
Group=Day
DynamicVariables=1
Meter=String
StringStyle=Bold
StringCase=Upper
FontColor=0,0,0,#FaceAlpha#
AntiAlias=1
MeasureName=MeasureCity
StringAlign=CenterCenter
X=111
Y=95
FontSize=11

;**********************************************************************************
;************************************Clock Hands *******************************

[MeterHrHandN]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=40
LineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=11
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=40
LineColor=0,0,0,#FaceAlpha#
LineWidth=11
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200

;**********************************************************************************

[MeterHrHand2N]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=43
LineLength=46
LineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand2]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=43
LineLength=46
LineColor=0,0,0,#FaceAlpha#
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


;**********************************************************************************

[MeterHrHand3N]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart= 49
LineLength=51
lineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


[MeterHrHand3]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart= 49
LineLength=51
lineColor=0,0,0,#FaceAlpha#
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200


;**********************************************************************************

[MeterMinHandN]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=0
LineLength=60
LineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=0
LineLength=60
LineColor=0,0,0,#FaceAlpha#
LineWidth=9
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterMinHand2N]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=62
LineLength=65
LineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand2]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=62
LineLength=65
LineColor=0,0,0,#FaceAlpha#
LineWidth=7
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterMinHand3N]
Group=Night
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=67
LineLength=69
LineColor=240,240,240,(255-#FaceAlpha#)
LineWidth=5
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

[MeterMinHand3]
Group=Day
DynamicVariables=1
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineStart=67
LineLength=69
LineColor=0,0,0,#FaceAlpha#
LineWidth=5
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;**********************************************************************************

[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=20
W=220
H=220
LineLength=95
LineColor=255,0,0,150
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=60

;**********************************************************************************

[CenterN]
Group=Night
Meter=Image
ImageName=#@#Images\gen_dotN.png
X=0
Y=20
W=220
H=220

[Center]
Group=Day
Meter=Image
ImageName=#@#Images\gen_dot.png
X=0
Y=20
W=220
H=220

;**********************************************************************************
I prefer the version that simply changes the face at sunrise and sunset, but this may give the OP a starting point.
You do not have the required permissions to view the files attached to this post.
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 21st, 2020, 8:29 am Alright, but a lot of resources (image files) are also required. That's why I asked for a package, which should contain the involved resources as well.
So, please help us to can help you and provide a complete package. Would be much easier to help.
I think you are looking for the images attached
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

the1ulike wrote: June 21st, 2020, 4:35 pm I think you are looking for the images attached
No, in fact when I asked to post a package I thought to the whole config packed, not just the images. However in meantime eclectic-tech posted a link above and I got the images (excepting for D1.png and N1.png) from there.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

eclectic-tech wrote: June 21st, 2020, 2:30 pm The first problem I see with trying to gradually change the clock colors is the current version uses 2 static images with integrated numerals; a white face with black numerals and a black face with white numerals. Changing from one to the other is done instantly when the day/night value is measured. You can change the day image gradually from white to black using ImageTint, but the numerals, bezel, and clock hands will disappear, you will only see a black circle with a second hand.
Although not perfect (in fact it's far from being perfect) another solution could use the ColorMatrix option of the Image meters. I rewrote the posted code, completely removing the WebParser measures, which in the offline solution are not needed anymore. This solution involves a lua script file, also included into the attached package. The code uses this time only one single Image meter for the clock face ([MeterClockFaceD]), I completely removed (well, in fact for now it is just commented out, but will be removed) the [MeterClockFaceN] meter. I also removed the group option of the remained [MeterClockFaceD] meter, as well as its hidden status. I added four ColorMatrix options, which inverts the color of the clock face in an interval equal with twice the value set for the newly added DuskTime variable. So, for the set DuskTime=60 variable, the complete recolor of the face takes 2 x 60 = 120 seconds = 2 minutes.
The only problem with this approach is a short period around the Sunrise and Sunset moment: then the face is getting grey and the numbers are not visible. The solution is exactly what have you said:
eclectic-tech wrote: June 21st, 2020, 2:30 pm One way this could be done is by creating an "alpha' variable and applying it to the day/night images and element colors.
Working on this, gonna post a sample code a little bit later (or maybe tomorrow).
Take care of the new variables, added to the [Variables] section:
  • Step is set automatically into the IfTrueAction options of the [MeasureDaySecs] measure, you don't have to take care about it.
  • Latitude and Longitude are the geographical coordinates of the desired location.
  • DuskTime is described above.
  • 12H, LeadingZeros and AMPM for now are needed as they are, please don't modify their value. They gonna be removed in the final code.
If anyone is interested (just please let me know), I'm gonna be back with a newer release soon. Stay tuned...
You do not have the required permissions to view the files attached to this post.
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

Thank you very much. I can see the time is not changed when we change the city coordinates. Can you advise how to select the city coordinates
My idea of change in this figure below
You do not have the required permissions to view the files attached to this post.