It is currently March 28th, 2024, 9:19 am

Clock face based on the sunset and sunrise

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16109
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 22nd, 2020, 9:52 am I can see the time is not changed when we change the city coordinates.
Should it? The Sun.lua script determines the currently set time zone on your computer and uses that one, regardless on the set geographical coordinates. You don't have to manually set it up the time zone and this is why when you set up the coordinates, the time isn't changing.
the1ulike wrote: June 22nd, 2020, 9:52 am Can you advise how to select the city coordinates
Simply adding your current geographical latitude and longitude to the Latitude and Longitude variables within the [Variables] section. Hope you know your coordinates, I don't know them. That's why I left empty the variables.
Note that the Latitude is positive for northern hemisphere and negative for the southern and a Longitude is positive for the eastern hemisphere and negative for the western.
the1ulike wrote: June 22nd, 2020, 9:52 am My idea of change in this figure below
So no gradual changing required anymore? Please decide what you want, because both cases can be done, just we should have to know which one to work with.
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 22nd, 2020, 3:35 pm
So no gradual changing required anymore? Please decide what you want, because both cases can be done, just we should have to know which one to work with.
I think you misunderstand me. Let me say it here: It is gradual changing from black to orange then sudden change from Orange (white text) to Orange (black text) then, gradual change from orange to White. This is to avoid the problem of a gray face at the exact time of sunrise or sunset
Attachments
1592849091650.jpg
the1ulike
Posts: 34
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

something like in the attached but with longer fading duration
Attachments
output4.mp4
(796.27 KiB) Downloaded 9 times
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

the1ulike wrote: June 22nd, 2020, 6:27 pm I think you misunderstand me. Let me say it here: It is gradual changing from black to orange then sudden change from Orange (white text) to Orange (black text) then, gradual change from orange to White. This is to avoid the problem of a gray face at the exact time of sunrise or sunset
Not sure if the OP is still checking, but this project caught my interest! 8-)
So I pursued the OP's request for gradual color changes and added a few enhancements :D

Here is a package that uses https://yandex.com/time/ for the on-line information for 8 locations (more or less can be utilized) and shows a "Sun Map" from http://www.e-callisto.org/ when the mouse hovers over the clock.

daynight8.gif
It will gradually change the clock face color towards red at sunrise and sunset, then towards white at sunrise and black at sunset. The transition time can be controlled by editing the 'TransitionSeconds' and the 'StepMax' variables. Default is 300 seconds (5 min) before/after sunrise/sunset, with 60 steps, so the color changes every 5 seconds over a 10 minute transition.

The 'IsNight' value from Yandex does not change immediately at sunrise/sunset, so I disable that measure and use IfConditions on the timestamp measures.

CHANGES
I created separate images for the clock face, white numerals, and black numerals.
I centered the clock hands from Y=20 to Y=15.
The transitions use 4 Loop measures that change a 'Step' value. That value is used in a ColorMatrix on the [MeterClockFace].
Added an optional location change at set intervals; see [MeasureRandom] on how to enable.
Added a 'Sun Map' that updates every 15 minutes.
Tested extensively, but may not have seen all possible scenarios :p

CREDITS
  • the1ulike for the initial idea (especially!)
  • balala for suggesting ColorMatrix
  • Yandex/Time site
  • e.callisto.org for the Sun Map
I recommend the1ulike to to make any changes he desires and share his creation on the forum. Also test for any possible bugs!
This is the only thread I plan to post this package.

EDITS
V1.2020.06.26
Corrected time (disabled daylight savings correction in the skin, it is done on the site)

V 1.2020.06.23a
Corrected logic for night face color prior to dawn.
Removed extra duplicate skins (2 included)... Copy 'Clock1' folder and rename to add more locations
Sun Map site can fail access, no map will show (Re-start Rainmeter should correct, looking at alternatives)
Attachments
DayNightClocks_1.2020.06.26.rmskin
(92.92 KiB) Downloaded 6 times
the1ulike
Posts: 34
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

eclectic-tech wrote: June 23rd, 2020, 4:19 pm
I recommend the1ulike to to make any changes he desires and share his creation on the forum. Also test for any possible bugs!
This is the only thread I plan to post this package.
Good job. Thank you so much. I'm in testing now. Mouse hovers are not working sometimes. I have noticed Sydney city is not responding to the time of night (it shows white face before sunrise)
Attachments
1592934683899.jpg
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

Yes, I see the same thing for Sydney (geoID=10145)... I need to add a few more conditional test to the timestamp measures to handle day/night colors.

In the meantime, you can correct this by changing 'Disabled=1' on [MeasureNight] to 'Disabled=0'. This will use the information from Yandex 'IsNight' to set the colors.

Once I add the additional condition tests, we should be able to disable that measure since it does not change for quite a while after sunrise/sunset times.

I may not get to that for a day or so... feel free to try adding to the conditions if you want... :sly:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

Code: Select all

[MeasureSunsetTime]
Group=Time
Disabled=1
Measure=Time
TimeStamp=[MeasureSunset]T[MeasureYear] [MeasureMonth] [MeasureDay]
TimeStampFormat=%H:%MT%Y %#d %b %A
DynamicVariables=1
IfCondition=([MeasureTime:]>([MeasureSunsetTime:TimeStamp]+#TransitionSeconds#))||([MeasureTime:]<([MeasureSunriseTime:TimeStamp]+#TransitionSeconds#))
IfTrueAction=[!SetVariable TextWhite 255][!SetVariable TextBlack 0][!SetVariable Step "-#StepsMax#"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetVariable TextWhite 0][!SetVariable TextBlack 255][!SetVariable Step "#StepsMax#"][!UpdateMeter *][!Redraw]
Try this change to [MeasureSunsetTime]. I added an additional test to see if the current time is prior to sunrise :phhht

Note: Remember to set [MeasureNight] back to 'Disabled=1' so it does not interfere with these actions.

Added this to the package posted here.
User avatar
balala
Rainmeter Sage
Posts: 16109
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 23rd, 2020, 5:52 pm Good job. Thank you so much. I'm in testing now. Mouse hovers are not working sometimes. I have noticed Sydney city is not responding to the time of night (it shows white face before sunrise)
So let's see. As far as I understand from the previous posts / replies, eclectic-tech and you are working on the online solution. My question is if you are still interested into my offline solution? Because if you are not, I'm not working anymore with it.
So, are you?
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 23rd, 2020, 7:31 pm So let's see. As far as I understand from the previous posts / replies, eclectic-tech and you are working on the online solution. My question is if you are still interested into my offline solution? Because if you are not, I'm not working anymore with it.
So, are you?
Please show us the offline approach
the1ulike
Posts: 34
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

eclectic-tech wrote: June 23rd, 2020, 6:58 pm Yes, I see the same thing for Sydney (geoID=10145)... I need to add a few more conditional test to the timestamp measures to handle day/night colors.

In the meantime, you can correct this by changing 'Disabled=1' on [MeasureNight] to 'Disabled=0'. This will use the information from Yandex 'IsNight' to set the colors.

Once I add the additional condition tests, we should be able to disable that measure since it does not change for quite a while after sunrise/sunset times.

I may not get to that for a day or so... feel free to try adding to the conditions if you want... :sly:
Please advise how can we control the color of the background instead of "Red" only (I'm interested in Orange color)
Post Reply