It is currently March 29th, 2024, 11:23 am

Clock face based on the sunset and sunrise

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
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 »

the1ulike wrote: June 24th, 2020, 7:48 am Please advise how can we control the color of the background instead of "Red" only (I'm interested in Orange color)
Red sky in the morning, sailors take warning!
Red sky at night, sailor's delight!


All aspects of the image change are done by adjusting the ColorMatrix values. I reduce the intensity of the green and blue values from 1 to zero using values of the loop measure in the formula Abs(#Step#/#StepMax#). To have it change to orange will require having ColorMatrix2 vary from 1 to 0.64 using the #Step# value in a new formula.

You need to create a formula in the ColorMatrix that will produce orange = rgb(255,165,0) = 1, 0.64, 0 when the value in the loop measure equals zero; that point in the loop is when [MeasurePreDawn] counts to zero, the numerals invert, and [MeasurePostDawn] is un-paused.

I would recommend reading the guide for ColorMatrix to get a better understanding of it process and then try different formulas in [MeterClockFace] ColorMatrix value.

You might want to install my ColorMatrix Playground skin to see the effects of different ColorMatrix values have on images. :sly:
cmp.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
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 24th, 2020, 6:07 am Please show us the offline approach
Shown once, but I admit that is not exactly as you asked for. But here is the rewritten code, exactly as you asked for:

Code: Select all

[Rainmeter]
SkinWidth=600

[Variables]
Latitude=- ADD THE LATITUDE -
Longitude=- ADD THE LONGITUDE -
12H=0
DuskTime=60
LeadingZeros=0
AMPM=1
AlphaN=0
AlphaD=0

[ClockFaceStyle]
X=0
Y=0
W=220
H=250
PreserveAspectRatio=1
DynamicVariables=1

[StringStyle]
X=111
Hidden=1
StringStyle=Bold
StringEffect=Border
AntiAlias=1

[RoundlineStyle]
X=0
Y=20
W=220
H=220
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
Hidden=1

[MeasureLuaScriptSun]
Measure=SCRIPT
ScriptFile=#@#Sun.lua

;[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.

[MeasureHour]
Measure=Time
Format=%#H
;Timezone=#TimeZone#

[MeasureMin]
Measure=Time
Format=%#M
;Timezone=#TimeZone#

[MeasureSec]
Measure=Time
Format=%#S
;Timezone=#TimeZone#

[MeasureDaySecs]
Measure=Calc
Formula=( 3600 * MeasureHour + 60 * MeasureMin + MeasureSec )
IfCondition=(#CURRENTSECTION#<#TimeSR#-#DuskTime#)
IfTrueAction=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!UpdateMeasure "#CURRENTSECTION#"][!Redraw]
IfCondition2=((#CURRENTSECTION#>#TimeSR#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSR#)&&(#CURRENTSECTION#<#TimeSS#))
IfTrueAction2=[!SetVariable AlphaN "(Clamp((255*((#TimeSR#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition3=((#CURRENTSECTION#>#TimeSR#)&&(#CURRENTSECTION#<(#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)))
IfTrueAction3=[!SetVariable AlphaD "(Clamp((255*(([#CURRENTSECTION#]-#TimeSR#)/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition4=((#CURRENTSECTION#>#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#-#DuskTime#))
IfTrueAction4=[!SetVariable AlphaD "255"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!UpdateMeasure "#CURRENTSECTION#"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition5=((#CURRENTSECTION#>#TimeSS#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction5=[!SetVariable AlphaD "(Clamp((255*((#TimeSS#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition6=((#CURRENTSECTION#>#TimeSS#)&&(#CURRENTSECTION#<#TimeSS#+#DuskTime#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction6=[!SetVariable AlphaN "(Clamp((255*(([#CURRENTSECTION#]-#TimeSS#)/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition7=(#CURRENTSECTION#>#TimeSS#+#DuskTime#)
IfTrueAction7=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
DynamicVariables=1

[MeasureTime]
Measure=Time
;Timezone=#TimeZone#
DynamicVariables=1

[MeasureTime2]
Measure=Time
;Timezone=#TimeZone#
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]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N.png
ImageAlpha=#AlphaN#
Group=ClockFaceN

[MeterClockFaceN1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N1.png
ImageAlpha=(255-#AlphaN#)
Group=ClockFaceN

[MeterClockFaceD]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D.png
ImageAlpha=#AlphaD#
Group=ClockFaceD

[MeterClockFaceD1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D1.png
ImageAlpha=(255-#AlphaD#)
Group=ClockFaceD

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

[MeterDigitalTimeN]
Group=Night
Meter=String
MeterStyle=StringStyle
FontColor=250,250,250
FontEffectColor=10,10,10
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1

[MeterDigitalTime]
Group=Day
Meter=String
MeterStyle=StringStyle
FontColor=10,10,10
FontEffectColor=250,250,250
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1 

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

[MeterDigitalDayOfWeekN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=255,255,255
FontEffectColor=10,10,10
Text=%1

[MeterDigitalDayOfWeek]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=0,0,0
FontEffectColor=250,250,250
Text=%1

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

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

[MeterDigitalDate]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
FontFace=Arial
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
Y=165
FontSize=10
Text=%1 %2

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

[MeterTZDisplayN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=255,255,255
FontEffectColor=10,10,10
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11

[MeterTZDisplay]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11

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

[MeterHrHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=240,240,240
LineWidth=11
ValueRemainder=43200

[MeterHrHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=0,0,0
LineWidth=11
ValueRemainder=43200

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

[MeterHrHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=240,240,240
LineWidth=9
ValueRemainder=43200

[MeterHrHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=0,0,0
LineWidth=9
ValueRemainder=43200

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

[MeterHrHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=240,240,240
LineWidth=7
ValueRemainder=43200


[MeterHrHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=0,0,0
LineWidth=7
ValueRemainder=43200

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

[MeterMinHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=240,240,240
LineWidth=9
ValueRemainder=3600

[MeterMinHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=0,0,0
LineWidth=9
ValueRemainder=3600

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

[MeterMinHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=240,240,240
LineWidth=7
ValueRemainder=3600

[MeterMinHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=0,0,0
LineWidth=7
ValueRemainder=3600

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

[MeterMinHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=240,240,240
LineWidth=5
ValueRemainder=3600

[MeterMinHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=0,0,0
LineWidth=5
ValueRemainder=3600

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

[MeterSecondsHand]
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=95
LineColor=255,0,0,150
LineWidth=2
ValueRemainder=60

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

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

[Center]
Group=Day
Hidden=1
Meter=Image
ImageName=#@#Clock\gen_dot.png
X=0
Y=20
W=220
H=220
Take care not to forget to add the appropriate geographical latitude and longitude. Without them, the code doesn't work. Also note that the Sun.lua file (included into the previously posted package) has to be in the @Resources folder. Hope you have it.
Does this work as expected?
the1ulike
Posts: 34
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 24th, 2020, 8:00 pm
Take care not to forget to add the appropriate geographical latitude and longitude. Without them, the code doesn't work. Also note that the Sun.lua file (included into the previously posted package) has to be in the @Resources folder. Hope you have it.
Does this work as expected?
I'm trying to test London, UK city so I set
Latitude=51.5074
Longitude=0.1278
But the clock is not showing the correct time ( it shows my local computer time). Also, the face is dark while the time is a day in both my local time and London city time. Please advice
User avatar
balala
Rainmeter Sage
Posts: 16110
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 25th, 2020, 9:22 am I'm trying to test London, UK city so I set
Latitude=51.5074
Longitude=0.1278
But the clock is not showing the correct time ( it shows my local computer time).
The clock always shows the local time of your computer. There indeed were some TimeZone options on the Time measures, but I removed them, in order to can easier work with the code. And, as usually, I forgot to put them back. I'm gonna add them back and will return here.
the1ulike wrote: June 25th, 2020, 9:22 am Also, the face is dark while the time is a day in both my local time and London city time.
It's not for me. So I packed my config, you can find it attached (didn't create a .rmskin installer, it's a plain .zip package). Please try out this package and let me know if it does work properly. Note that the included skin also shows the local time of your computer for now, as said, I'm gonna try fixing this.
You do not have the required permissions to view the files attached to this post.
the1ulike
Posts: 34
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 25th, 2020, 10:25 am It's not for me. So I packed my config, you can find it attached (didn't create a .rmskin installer, it's a plain .zip package). Please try out this package and let me know if it does work properly. Note that the included skin also shows the local time of your computer for now, as said, I'm gonna try fixing this.
Could you please make it clear what are the variables we need for your offline approach? I think the time zone will not be able to get from the city coordinates.
So far, it does not work for me at all. What is #Valami#
User avatar
balala
Rainmeter Sage
Posts: 16110
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 25th, 2020, 4:37 pm Could you please make it clear what are the variables we need for your offline approach?
  • I suppose you know what Latitude and Longitude are.
  • TimeZone is the desired time zone. Use TimeZone=local to use the local time zone.
  • 12H, LeadingZeros and AMPM are some generic variables which are used by the Sun.lua script file. They have no importance from the point of view of the skin, but are needed into the script file, so leave them there unchanged.
  • DuskTime is the amount of time which the orange faces are visible when the gradual changes are going on.
  • AlphaN and AlphaD are two variables used by the operation of gradual change of the faces. These are needed into the code and are dynamically changing when the transitions are going on.
Note that I just figured out that the TimeZone variable, in this form is not working properly, so I had to rename this variable to TimeZ. Please replace the code with the following one:

Code: Select all

[Rainmeter]
SkinWidth=600

[Variables]
Latitude=51.5074
Longitude=0.1278
TimeZ=local
12H=0
DuskTime=60
LeadingZeros=0
AMPM=1
AlphaN=0
AlphaD=0

[ClockFaceStyle]
X=0
Y=0
W=220
H=250
PreserveAspectRatio=1
DynamicVariables=1

[StringStyle]
X=111
Hidden=1
StringStyle=Bold
StringEffect=Border
AntiAlias=1

[RoundlineStyle]
X=0
Y=20
W=220
H=220
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
Hidden=1

[MeasureLuaScriptSun]
Measure=SCRIPT
ScriptFile=#@#Sun.lua

;[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.

[MeasureHour]
Measure=Time
Format=%#H
TimeZone=#TimeZ#

[MeasureMin]
Measure=Time
Format=%#M
TimeZone=#TimeZ#

[MeasureSec]
Measure=Time
Format=%#S
TimeZone=#TimeZ#

[MeasureDaySecs]
Measure=Calc
Formula=( 3600 * MeasureHour + 60 * MeasureMin + MeasureSec )
IfCondition=(#CURRENTSECTION#<#TimeSR#-#DuskTime#)
IfTrueAction=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!UpdateMeasure "#CURRENTSECTION#"][!Redraw]
IfCondition2=((#CURRENTSECTION#>#TimeSR#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSR#)&&(#CURRENTSECTION#<#TimeSS#))
IfTrueAction2=[!SetVariable AlphaN "(Clamp((255*((#TimeSR#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition3=((#CURRENTSECTION#>#TimeSR#)&&(#CURRENTSECTION#<(#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)))
IfTrueAction3=[!SetVariable AlphaD "(Clamp((255*(([#CURRENTSECTION#]-#TimeSR#)/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition4=((#CURRENTSECTION#>#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#-#DuskTime#))
IfTrueAction4=[!SetVariable AlphaD "255"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!UpdateMeasure "#CURRENTSECTION#"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition5=((#CURRENTSECTION#>#TimeSS#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction5=[!SetVariable AlphaD "(Clamp((255*((#TimeSS#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition6=((#CURRENTSECTION#>#TimeSS#)&&(#CURRENTSECTION#<#TimeSS#+#DuskTime#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction6=[!SetVariable AlphaN "(Clamp((255*(([#CURRENTSECTION#]-#TimeSS#)/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition7=(#CURRENTSECTION#>#TimeSS#+#DuskTime#)
IfTrueAction7=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
DynamicVariables=1

[MeasureTime]
Measure=Time
TimeZone=#TimeZ#
DynamicVariables=1

[MeasureTime2]
Measure=Time
TimeZone=#TimeZ#
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]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N.png
ImageAlpha=#AlphaN#
Group=ClockFaceN

[MeterClockFaceN1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N1.png
ImageAlpha=(255-#AlphaN#)
Group=ClockFaceN

[MeterClockFaceD]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D.png
ImageAlpha=#AlphaD#
Group=ClockFaceD

[MeterClockFaceD1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D1.png
ImageAlpha=(255-#AlphaD#)
Group=ClockFaceD

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

[MeterDigitalTimeN]
Group=Night
Meter=String
MeterStyle=StringStyle
FontColor=250,250,250
FontEffectColor=10,10,10
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1

[MeterDigitalTime]
Group=Day
Meter=String
MeterStyle=StringStyle
FontColor=10,10,10
FontEffectColor=250,250,250
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1 

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

[MeterDigitalDayOfWeekN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=255,255,255
FontEffectColor=10,10,10
Text=%1

[MeterDigitalDayOfWeek]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=0,0,0
FontEffectColor=250,250,250
Text=%1

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

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

[MeterDigitalDate]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
FontFace=Arial
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
Y=165
FontSize=10
Text=%1 %2

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

[MeterTZDisplayN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=255,255,255
FontEffectColor=10,10,10
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11

[MeterTZDisplay]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11

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

[MeterHrHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=240,240,240
LineWidth=11
ValueRemainder=43200

[MeterHrHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=0,0,0
LineWidth=11
ValueRemainder=43200

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

[MeterHrHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=240,240,240
LineWidth=9
ValueRemainder=43200

[MeterHrHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=0,0,0
LineWidth=9
ValueRemainder=43200

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

[MeterHrHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=240,240,240
LineWidth=7
ValueRemainder=43200


[MeterHrHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=0,0,0
LineWidth=7
ValueRemainder=43200

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

[MeterMinHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=240,240,240
LineWidth=9
ValueRemainder=3600

[MeterMinHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=0,0,0
LineWidth=9
ValueRemainder=3600

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

[MeterMinHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=240,240,240
LineWidth=7
ValueRemainder=3600

[MeterMinHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=0,0,0
LineWidth=7
ValueRemainder=3600

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

[MeterMinHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=240,240,240
LineWidth=5
ValueRemainder=3600

[MeterMinHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=0,0,0
LineWidth=5
ValueRemainder=3600

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

[MeterSecondsHand]
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=95
LineColor=255,0,0,150
LineWidth=2
ValueRemainder=60

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

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

[Center]
Group=Day
Hidden=1
Meter=Image
ImageName=#@#Clock\gen_dot.png
X=0
Y=20
W=220
H=220
the1ulike wrote: June 25th, 2020, 4:37 pm I think the time zone will not be able to get from the city coordinates.
Definitely. In the offline approach, this is not possible. You have to set the time zone manually, but I renamed the appropriate variable to TimeZ (see above).
the1ulike wrote: June 25th, 2020, 4:37 pm So far, it does not work for me at all.
What do you mean by "not work at all"? What time does the clock show (supposing it does show something)?
the1ulike wrote: June 25th, 2020, 4:37 pm What is #Valami#
It's a control variable, I had to add to the code while I was working with it. From your point it has no practical purpose. I should had to remove it when I uploaded the skin, but as usually, I forgot. I removed from the above code.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
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 »

Still shows local time...
To show time at the lat/lon, change the [Variables]:
TimeZ=Local to TimeZ=Locale
User avatar
balala
Rainmeter Sage
Posts: 16110
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 26th, 2020, 4:18 am Still shows local time...
To show time at the lat/lon, change the [Variables]:
TimeZ=Local to TimeZ=Locale
Simply: :o :jawdrop :o :jawdrop :o
Had no idea about this, but it works perfectly. However as far as i can tell, this is not documented. Or is it and I just missed it somewhere?
Thank you eclectic-tech for pointing this detail. :thumbup:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Clock face based on the sunset and sunrise

Post by jsmorley »

balala wrote: June 26th, 2020, 11:54 am Simply: :o :jawdrop :o :jawdrop :o
Had no idea about this, but it works perfectly. However as far as i can tell, this is not documented. Or is it and I just missed it somewhere?
Thank you eclectic-tech for pointing this detail. :thumbup:
I'm not following this thread closely, but it should be noted that it is:

TimeZone=Local

To have the measure use the computer's local time for the timezone.

Now, that is also the default, so if you use:

TimeZone=Locale

Which is an invalid value for that option, then it's the same as using the valid "Local" value.

In a sense, the term "Locale" is a "question", not an "answer". That's why you have:

FormatLocale=Local
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
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 »

jsmorley wrote: June 26th, 2020, 12:05 pm I'm not following this thread closely, but it should be noted that it is:

TimeZone=Local

To have the measure use the computer's local time for the timezone.

Now, that is also the default, so if you use:

TimeZone=Locale

Which is an invalid value for that option, then it's the same as using the valid "Local" value.

In a sense, the term "Locale" is a "question", not an "answer". That's why you have:

FormatLocale=Local
We are not setting the "TimeZone", we are setting a variable "TimeZ". :???:

When used as I did, TimeZ=Locale the skin will show the time based on the Latitude/Longitude values in the [Variables] section. So there is something in the code or Lua script that is making it work.

But, thanks for the clarification on valid values for TimeZone and time formats...